You can think of tristate buffers as a way of turning a signal on and off. When the enable input at the top of the buffer is '1', the tristate buffer acts like a normal buffer. But when the enable input is '0', the buffer "turns off" by giving a very high impedance output. This effectively "disconnects" the buffer from the circuit. So if you need to turn off a signal, ground the enable input of the tristate buffer.
What "three states" means
An ordinary logic output has two states: it drives the line high or drives it low. A tristate (three-state) buffer adds a third: high impedance, usually written Z. In the Z state the output neither sources nor sinks current, so it behaves as if it were unplugged from the wire. Whatever else is connected to that wire decides its voltage.
| Enable | Input A | Output Y |
|---|---|---|
| 1 (active) | 0 | 0 |
| 1 (active) | 1 | 1 |
| 0 (inactive) | X (don't care) | Z (high impedance) |
Watch the enable polarity
The table above is for a buffer with an active-high enable, as described at the top of this post. Many real parts use an active-low enable instead. For example, the four buffers in Texas Instruments' SN74HC125 datasheet each have an output enable pin, OE, that is active low: the output follows A when OE is low and goes to Z when OE is high. On such a part, grounding the enable turns the output on, not off. Always check the bubble on the symbol or the function table before wiring the enable.
Why tristate buffers exist: shared buses
The main use is letting several devices share one set of wires. A memory, a processor and a peripheral can all connect to the same data bus, each through its own tristate driver. At any moment the bus controller enables exactly one driver; all the others sit in Z and simply listen. Without the third state, two outputs connected together would fight each other.
Other common uses:
- Bidirectional pins: an I/O pin pairs an input buffer with a tristate output buffer. Enable the output to transmit; disable it to receive.
- Isolating powered-down circuits: the SN74HC125 datasheet describes disabling a bus when the circuit it drives is powered off, so no voltage is forced onto the unpowered inputs.
- Open-collector style signals: a buffer whose input is tied low and whose enable carries the data can only pull low or let go, which emulates an open-drain output.
Two rules that prevent most problems
- Never enable two drivers at once. If one drives high and the other low, current flows straight from supply to ground through both outputs. This is bus contention: it wastes power, corrupts data and can damage parts.
- Never let a bus float for long. When every driver is in Z, nothing defines the voltage. CMOS inputs on a floating line can drift into the switching region, draw extra current and even oscillate. A pull-up or pull-down resistor, or a bus-hold circuit, keeps the line at a defined level.
Deep dive: the numbers and details
This part holds datasheet figures, a worked float-time calculation and HDL code. Skip it if the overview is all you need.
What the datasheet tells you
The SN74HC125 datasheet (revision SCLS104F, April 2021) specifies the parameters that matter for a tristate part:
- IOZ, three-state leakage current: with the output in Z and VCC = 6 V, typically ±0.01 µA, at most ±0.5 µA at 25°C and ±5 µA over the -40°C to 85°C range.
- ten and tdis, enable and disable delays: separate timing figures from OE to Y, measured as the time to leave or enter the Z state.
- Pull resistors on a disabled output: the datasheet notes that a pull-up or pull-down resistor can hold the output high or low while it is in the high-impedance state, and that a 10 kΩ value is often used on inputs that need a default level.
The enable and disable delays matter when handing a bus from one driver to another. If the new driver's enable time is shorter than the old driver's disable time, both drive the bus for a moment. Bus controllers leave a gap, sometimes called a turnaround cycle, to avoid this.
Worked example: how long can a bus float?
Texas Instruments' application report "Implications of Slow or Floating CMOS Inputs" (SCBA004E) works through this in its Bus Control section. A floating line is a capacitor charged by leakage current:
dV/dt = I_OZ / C = 50 µA / 20 pF = 2.5 V/µs
Starting from 0 V, the line reaches the 0.8 V maximum low-level input voltage of a TTL-compatible input in 0.8 / 2.5 = 0.32 µs. So, in that example, the bus may float for no more than 320 ns. The report notes the time constant does not change with more devices on the bus, because their leakage currents and capacitances add together. For longer idle periods it recommends a pull-up or pull-down resistor, usually 1 kΩ to 10 kΩ, or bus-hold circuits.
Sizing the pull-up
The resistor sets how fast the line returns to its default level once all drivers release it. With 10 kΩ and 20 pF, the time constant is R × C = 200 ns, and the line reaches about 63% of its final value in one time constant. A smaller resistor is faster but costs more current whenever a driver pulls the line the other way: at 5 V, a 1 kΩ pull-up draws 5 mA from the driver holding the line low, while 10 kΩ draws 0.5 mA. The TI report also warns that the resistor must not make the input transition slower than the device's maximum input transition time.
Tristate buffers in Verilog and VHDL
// Verilog: active-high enable
assign y = en ? a : 1'bz;
// Verilog: active-low enable, like one channel of a 74HC125
assign y = !oe_n ? a : 1'bz;
-- VHDL (std_logic)
y <= a when en = '1' else 'Z';
A bidirectional pin combines both directions:
module bidir_pin (inout wire pad, input wire out_data, out_en,
output wire in_data);
assign pad = out_en ? out_data : 1'bz; // drive when enabled
assign in_data = pad; // always listen
endmodule
In simulation, two active drivers with opposite values resolve to X, which is how contention shows up in a waveform. Add a check in the testbench that at most one enable on each shared bus is active at any time.
Interview angle
- "What is the third state?" High impedance: the output is effectively disconnected and neither sources nor sinks current, apart from a small leakage.
- "What happens if two tristate drivers are enabled together?" Contention: a direct supply-to-ground current path if they disagree, an X in simulation, and possible damage in hardware.
- "What does a floating bus do?" It drifts with leakage, can sit near the input threshold and cause extra current or oscillation; fix it with a pull resistor or bus hold.


Your comments will be moderated before it appears here.