top.v 509 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 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
module top
(
 input x,
 input y,
 input cin,

 output reg A,
 output cout
 );
 parameter X = 1;
 wire o_mid,o_rtl;

always @(posedge cin)
	A <= o_mid;

middle u_mid (.x(x),.y(o_rtl),.o(o_mid));
u_rtl inst_u_rtl (.x(o_mid),.y(y),.o(o_rtl));

endmodule

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

wire o1,o2;

assign o1 = x & o2;
assign o2 = y & o1;
assign o = o1;
endmodule

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


wire o1,o2;

assign o1 = x & o2;
assign o2 = y & o1;
assign o = o1;
endmodule