top.v 214 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
module top
(
 input x,
 input y,
 input cin,

 output A,
 output cout
 );
wire  p,r,s;
	xor (p,x,y);
`ifndef BUG
	xor (A,p,cin);
`else
	and (A,p,cin);
`endif
 
	and(r,p,cin);
	and(s,x,y);
	or(cout,r,s);

endmodule