adder.txt

来自「this code written in systemc language an」· 文本 代码 · 共 77 行

TXT
77
字号


// this languge call systemc and very important to simulate the system and teach the student how the micro works

#include "systemc.h"

#define WIDTH  4

SC_MODULE(adder) {
  sc_in<sc_uint<WIDTH> > a, b;  
  sc_out<sc_uint<WIDTH> > sum;

  void do_add() {
    sum.write(a.read() + b.read());
  }

  SC_CTOR(adder)       {
    SC_METHOD(do_add);   
    sensitive << a << b; 
  }
};


///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////
///////////////////////////////////////////////
////////////////////////////////////////////////
//////////////////////////////////////////
//for any asks
send me email to tell you about this language

//this program call adder 
and it is add two number and have the result in sum
///////////////////////////////////////////////////
//////////////////////////////////////////////////////
///////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//////////////////////////////////////////////////

////////////////////////////////////////////////


///////////////////////////////////////////////////





///////////////////////////////////////////////////
/////////////////////////////////////////////

/////////////////////////////////////////////////////

///////////////////////////////////////////////////////

////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
//////////////////////////////////////////////////////
/////////////////////////////////////////////////////
///////////////////////////////////////////////////////
////////////////////////////////////////////////////
//////////////////////////////////////////////////
///////////////////////////////////////////////////
///////////////////////////////////////////
////////////////////////////////////////////////
/////////////////////////////////////////////////
////////////////////////////////////////////////
///////////////////////////////////////////////////
///////////////////////////////////////////
////////////////////////////////////////////////////////////
///////////////////////////////////////////

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?