Advertisement
kekellner

Lab08 - Ej01 - FullAdder

Oct 15th, 2021
2,064
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module full_adder (input A, B, Cin, output S, Cout);
  2.  
  3.     assign S = A ^ B ^ Cin;
  4.     assign Cout = A & B | A & Cin | B & Cin;
  5.  
  6.     /*
  7.     Mismo circuito, pero en un bloque 'always'. Lo dejo aquí como referencia únicamente.
  8.  
  9.     reg rS, rCout;
  10.  
  11.     always @ (A or B) begin
  12.         rS = A ^ B ^ Cin;
  13.         rCout = A & B | A & Cin | B & Cin;
  14.     end
  15.  
  16.     assign S = rS;
  17.     assign Cout = rCout;
  18.     */
  19.  
  20. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement