Verilog code sample for the flip-flop/register triggered with a positive-edge clock. module tristate (T, In, Out); input T, In; output Out; reg Out; always @(T or In) begin if (~T) Out = In; else Out = 1'bZ; end endmodule