	/*** 1 Bit Full Adder ***/

module adder_1bit(carry,sum,a,b,cin);

input a,b,cin;
output carry,sum;
wire s1,c1,c2;

xor1 x1(.c(s1),.a(a),.b(b));
xor1 x2(.c(sum),.a(s1),.b(cin));
//sum = a xor b xor cin
and a1(c1,a,b);
and a2(c2,s1,cin);
or o1(carry,c1,c2);
// carry= (a & b) or [cin & (a xor b)]   
endmodule

