Tri-State Buffers and Bus Contention
โ† All articles

Tri-State Buffers and Bus Contention

5 min

A third state besides 0 and 1

An ordinary gate output is always actively driving either 0 or 1. A tri-state buffer adds a third possibility: when its Enable input is low, the output disconnects entirely โ€” high impedance (Hi-Z) โ€” as if the wire were unplugged rather than driven to any voltage. Boolflow models this directly with its TRIBUF element: one data input, one enable input, one output that either follows the data or floats.

Why share a wire at all

A bus is a set of wires that several devices need to write to at different times โ€” a memory bus with multiple chips, or a register file with multiple read ports feeding one output. Instead of routing every source through a multiplexer, tie several tri-state buffer outputs directly to the same wire and enable exactly one driver at a time; whichever buffer is enabled writes the bus, and every other buffer stays disconnected.

D1TRIBUFEN1D2TRIBUFEN2shared wire

Contention and floating buses

Two failure modes come from getting the enable logic wrong. Enable two drivers at once when they disagree, and both actively fight to drive the same wire to opposite voltages โ€” contention, which in real hardware wastes power and can damage the drivers. Enable zero drivers, and the bus floats: whatever reads it sees an undefined, noise-sensitive value rather than a clean 0 or 1.

How Boolflow handles a shared wire

To share a wire in Boolflow, connect several TRIBUF outputs to the same input pin. The simulator resolves it the way a real bus behaves: a disabled driver releases the wire, and the enabled one sets its value. If two enabled drivers disagree, the wire reads as unknown rather than a guess. The Check tool reports exactly these situations โ€” drivers that disagree right now, a bus that nothing is driving, and ordinary gate outputs tied together, which is never legitimate because only a tri-state output can let go of the wire.

Try it yourself

Build a shared bus from two TRIBUF elements in the circuit editor and toggle their Enable lines by hand: with one enabled the bus follows it, with neither enabled it reads "?", and with both enabled on different data the Check page flags the conflict.

Open a shared bus of two TRIBUF elements โ†’