An ordinary gate always drives its output to 0 or 1. A tri-state buffer adds a third option: let go.
It has a data input A, an enable E and an output Y:
- E active: Y = A. The buffer drives the wire.
- E inactive: Y = Z, high impedance. The output is electrically disconnected, as if the wire were cut.
Why that matters: it lets many outputs share one wire. Picture eight memory chips all connected to the same data bus. If every chip drove the bus all the time, they would fight. With tri-state outputs, only the selected chip's buffers are enabled, and everyone else is at Z.
That's exactly what happens inside a memory: the chip select (and output enable, if present) control the tri-state buffers on the data outputs. They drive only during a read of the selected chip.
Rules for a shared bus:
- At most one driver enabled at a time. Two enabled drivers with different values cause bus contention.
- If no driver is enabled, the bus floats at Z, and readers get an undefined value.
Z isn't a third Boolean value you can compute with. It means "this output isn't taking part", and it only makes sense for wires that something else may drive.