top.v 353 Bytes
Newer Older
1 2 3 4 5 6 7 8
module tristate (en, i, o);
    input en;
    input i;
    output o;

    always @(en or i)
		begin
			case (en)
9
`ifndef BUG 
10
				1:o <= i;
11 12 13
`else
				1:o <= ~i;
`endif
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
				default :o <= 1'bZ;
			endcase
		end
endmodule


module top (
input en,
input a,
output b
);

tristate u_tri (
        .en (en ),
        .i (a ),
        .o (b )
    );

endmodule