mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			382 B
		
	
	
	
		
			Verilog
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			382 B
		
	
	
	
		
			Verilog
		
	
	
	
	
	
| module addbit (
 | |
| a      , // first input
 | |
| b      , // Second input
 | |
| ci     , // Carry input
 | |
| sum    , // sum output
 | |
| co       // carry output
 | |
| );
 | |
| //Input declaration
 | |
| input a;
 | |
| input b;
 | |
| input ci;
 | |
| //Ouput declaration
 | |
| output sum;
 | |
| output co;
 | |
| //Port Data types
 | |
| wire  a;
 | |
| wire  b;
 | |
| wire  ci;
 | |
| wire  sum;
 | |
| wire  co;
 | |
| //Code starts here
 | |
| assign {co,sum} = a + b + ci;
 | |
| 
 | |
| endmodule // End of Module addbit
 |