8-Bit Ripple Carry Adder using Full Adder:
module ripple_8adder(
input [7:0] a,
input [7:0] b,
input cin,
output [7:0] sum,
output carry );
wire [6:0]c;
fulladder
FA1(a[0],b[0],cin,sum[0],c[0]);
fulladder
FA2(a[1],b[1],c[0],sum[1],c[1]);
fulladder
FA3(a[2],b[2],c[1],sum[2],c[2]);
fulladder
FA4(a[3],b[3],c[2],sum[3],c[3]);
fulladder
FA5(a[4],b[4],c[3],sum[4],c[4]);
fulladder
FA6(a[5],b[5],c[4],sum[5],c[5]);
fulladder
FA7(a[6],b[6],c[5],sum[6],c[6]);
fulladder FA8(a[7],b[7],c[6],sum[7],carry);
endmodule
Hint: For Module fulladder refer previous posts
No comments:
Post a Comment