Advertisement
varli_ketanpl

AC_LAB1_EX1

Oct 11th, 2023
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module half_adder(
  2.         output sum,
  3.         output c_out,
  4.         input a, b);
  5.    
  6.     xor x1(sum, a, b);
  7.     and an1(c_out, a, b);
  8. endmodule
  9.  
  10. module full_adder(
  11.         output sum,
  12.         output c_out,
  13.     input a, b, c_in);
  14.    
  15.     wire o1, o2, o3;
  16.     half_adder h1(sum, o1, c_in, o2);
  17.     half_adder h2(o2, o3, a, b);
  18.     or or1(o1, o3);
  19. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement