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
| EN | A | OUT |
|---|---|---|
| 0 | 0 | Z |
| 0 | 1 | Z |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
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
- Exactly one enable is active per bus cycle, enforced by decode logic.
- Disabled drivers present Z and neither help nor fight the active one.
- A pull-up or pull-down resistor may define the level when no one drives.
- Overlapping enables must be avoided to prevent momentary contention.
In code
python
def tristate(a, en):
return a if en else 'Z' # Z models the disconnected stateWhere 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.