top.v 346 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
module top
(
 input x,
 input y,
 input cin,

 output reg A,
 output cout
 );
 parameter WIDTH = 1;
 wire o;

`ifndef BUG
14 15
//always @(posedge cin)
//	A <= o;
16

17
assign cout =  cin ? y : x;
18

19
//middle u_mid (x,y,o);
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
`else
assign {cout,A} =  cin - y * x;
`endif

endmodule

module middle
(
	input x,
	input y,
	output o
);

assign o = x + y;
endmodule