Advertisement
varli_ketanpl

AC_LAB1_EX2

Oct 11th, 2023 (edited)
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module add4(
  2.     output[3:0] sum,
  3.     output c_out,
  4.     input[3:0] a, b);
  5.    
  6.     wire c_in1, c_in2, c_in3;
  7.     full_adder f1(sum[0], c_in1, a[0], b[0], 0);
  8.     full_adder f2(sum[1], c_in2, a[1], b[1], c_in1);
  9.     full_adder f3(sum[2], c_in3, a[2], b[2], c_in2);
  10.     full_adder f4(sum[3], c_out, a[3], b[3], c_in3);
  11. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement