Lab 01 Submitted To
Lab 01 Submitted To
Section
Lab Submitted To :
01
SIR FAHAD ISLAM CHEEMA
DDl
Lab
Half Adder:
Code: module Halfadder(s,c,a,b); input a,b; output s,c; and a1(c,a,b); xor x1(s,a,b); endmodule
Full adder using two half adders (one bit full adder) :
Code: module Fulladderusingtwohalfadders(s,cout,a,b,cin); input a,b,cin; output s,cout; wire s1,c1,c2; Halfadder ha1(s1,c1,a,b); Halfadder ha2(s,c2,s1,cin); or (cout,c1,c2); endmodule