Search This Blog

Thursday, 31 October 2013

Verilog Code for 4-Bit Full Adder using 1-Bit Adder

Sr. No.
Name of the Pin
Direction
Width
Description
1
a
Input
4
Data Input
2
b
Input
4
Data Input
3
cin
inout
1
Input carry
4
Sum
Output
4
Summation
5
Cout
Output
1
Carry


module full_adder_4b(sum,cout,a,b,cin);
   output [3:0] sum;
   output  cout;
   input [3:0]  a,b;
   input  cin;

   full_adder f1 (sum[0], cout0, a[0], b[0], cin);
   full_adder f2 (sum[1], cout1, a[1], b[1], cout0);
   full_adder f3 (sum[2], cout2, a[2], b[2], cout1);
   full_adder f4 (sum[3], cout, a[3], b[3], cout2);

endmodule

No comments:

Post a Comment