The Verilog Hardware Description Language, Fifth Edition

Tri-state devices are combinational logic circuits that have three output values: one, zero, and high impedance ( z). Having special, non-typical capabilities, these devices must be inferred from the description. Example 2.20 illustrates a tri-state inference.
module synTriState (output reg bus, input in, driveEnable); always @(*) if (driveEnable) bus = in; else bus = 1'bz; endmodule
The always statement in this module follows the form for describing a combinational logic function. The special situation here is that a condition (in this case, driveEnable) specifies a case where the output will be high impedance. Synthesis tools infer that this condition will be the tri-state enable in the final implementation.