Computing Library › Classical Logic Gates
Classical Logic Gates

Tri-State Buffer

A tri-state buffer passes its input when enabled and presents a high-impedance open circuit when disabled, letting many drivers share one wire.

Three output states

An ordinary gate drives 0 or 1. A tri-state buffer adds a third state, high impedance, written Z. In Z the output is effectively disconnected, neither pulling high nor low, as if the wire were cut.

Truth table

ENAOUT
00Z
01Z
100
111

Why high impedance matters

On a shared bus many devices connect to the same lines. If two of them drove opposing values at once the result would be a contention short. Tri-state control ensures that at most one driver is enabled at a time; all others sit in Z and listen.

Bus discipline

In code

python

def tristate(a, en):
    return a if en else 'Z'  # Z models the disconnected state

Where it appears

Tri-state buffers underpin data buses, bidirectional pins, and memory interfaces, where many sources must take turns on shared wires. Modern designs often replace them with multiplexers internally, but the tri-state model remains the clearest way to reason about shared buses.