|  | 
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  
|  |  | Adder |  
|  |  | 
 |  
|  |  | 
  1 #include "systemc.h"
  2 
  3 #define WIDTH  4
  4 
  5 SC_MODULE(adder) {
  6   sc_in<sc_uint<WIDTH> > a, b;  
  7   sc_out<sc_uint<WIDTH> > sum;
  8 
  9   void do_add() {
 10     sum.write(a.read() + b.read());
 11   }
 12 
 13   SC_CTOR(adder)       {
 14     SC_METHOD(do_add);   
 15     sensitive << a << b; 
 16   }
 17 };
You could download file sc_examples here |  
|  |  | 
 |  
|  |  | 
 |  
|  |  | 
 |  
|  |  |  |  
|  |  | 
 |  |  | 
|  
 |  
 |  
 | 
| 
 | 
|    |  
| Copyright © 1998-2025 |  
| Deepak Kumar Tala - All rights reserved |  
| Do you have any Comment? mail me at:deepak@asic-world.com
 |  |