Skip to content
digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksToolsOpen the lab →

Tri-state buffer from transistors: 0, 1 or Z, live

A tri-state buffer passes its input A to its output Y when the enable EN is 1, and disconnects the output, leaving it floating in the high-impedance state Z, when EN is 0. This CMOS version uses eight transistors: an inverter on A, an inverter on EN, and a tri-state inverter of four transistors stacked between VDD and GND.

The tri-state inverter is the heart of it: two PMOS in series from VDD to Y, gated by NOT EN and NOT A, and two NMOS in series from Y to GND, gated by NOT A and EN. With EN = 0 the outer transistor of each stack is off, so neither network can reach Y. With EN = 1 both outer transistors are on and the inner pair works as an ordinary inverter on NOT A, so Y = A. Unlike a transmission gate, which only connects two wires, a tri-state buffer drives Y from the supply rails, so it restores a weak signal. That is why buses use tri-state drivers: many share one wire and the control logic enables exactly one at a time; two enabled at once with different values would connect VDD to GND. Read more in the tri-state lesson and on buses.

Live circuit: click the inputs to toggle them and watch the outputs update. It runs the real simulator, right here on the page.

Open this circuit in the lab →

What you need

Step by step

  1. Place VDD, GND, inputs A and EN, and a probe Y.
  2. Build two CMOS inverters, for NOT A and NOT EN.
  3. Pull-up: two PMOS in series from VDD to Y, the outer one gated by NOT EN and the inner one by NOT A.
  4. Pull-down: two NMOS in series from Y to GND, the inner one gated by NOT A and the outer one by EN.
  5. With EN = 1, Y follows A. With EN = 0, Y floats (Z).

Tri-state buffer truth table

ENAPMOS stackNMOS stackY
00offoffZ (floating)
01offoffZ (floating)
10offon0
11onoff1

All four rows, including the two floating ones, are checked on the live circuit, which is made of transistors only, before the page is built. It starts with A = 1 and EN = 0, so Y floats until you turn EN on.

You can also read the full theory in the lesson on tri-state buffers. Prefer to build it yourself from scratch? Open the digiwleea lab and place the gates on the canvas, or start from the logic gate simulator.

Build more parts from gates

half adderfull adderhalf subtractorfull subtractor2:1 multiplexer4:1 multiplexerXOR gate from NAND gates2-to-4 decoderSR latchD flip-flopJK flip-flopT flip-flop4-bit shift register4-bit ripple carry adderD latch1-to-4 demultiplexer4-bit magnitude comparator4-bit ring counter4-bit Johnson counter4-to-2 priority encoder4-bit synchronous counter3-to-8 decoder8-to-1 multiplexer4-bit carry lookahead adderhalf adder from NAND gates2-bit comparatorBCD to 7-segment decoder4-bit up/down counterdecade counter2-bit multiplier4-bit ALU4-bit array multiplierNOT, AND, OR and NOR from NANDNOT, OR, AND and XOR from NORfull adder from NAND gatesSR latch from NAND gatesparity generator and checker4-bit adder/subtractorBCD adder4-bit universal shift registermod-6 counter4-bit ripple counterbinary to Gray code converterhalf adder from NOR gatesfull adder from NOR gates4-bit register with parallel load1011 sequence detectorbinary to BCD converterD flip-flop from NAND gates1-bit ALUCMOS inverterCMOS NAND gateCMOS NOR gatePISO shift registerSR flip-flop from NAND gatesBCD to excess-3 code converterHamming (7,4) code encoder and correctortraffic light controller4-bit barrel shifterCMOS AND gateCMOS OR gateCMOS XOR gate1-bit magnitude comparatorhalf subtractor from NAND gatesfull subtractor from NAND gates8-to-3 encoderGray to binary converter4-to-16 decoderfull adder using 4:1 multiplexersedge detectorserial adder4-bit carry-select adderMealy machine (1011 detector)master-slave JK flip-flop (NAND)half subtractor from NOR gates1-to-8 demultiplexerexcess-3 to BCD code convertervending machine FSM4-bit carry-save adder3-bit synchronous counter (JK)CMOS transmission gate2-to-1 mux from transmission gatesmod-5 counterflip-flop conversion (JK to D)8-bit ALUdecimal to BCD encoderBCD to decimal decoder4-to-1 mux from 2-to-1 muxes

Each of these is one step from a transistor to a working CPU. Build every gate from CMOS transistors and work all the way up in the free digiwleea lab, with the free theory reference alongside.

Open the tri-state buffer (CMOS) in the lab →

Frequently asked

What is a tri-state buffer?

A buffer with an enable input: when enabled, its output copies its input; when disabled, its output is disconnected and floats in the high-impedance state Z, so other drivers can use the same wire.

What does high impedance (Z) mean?

The output is neither pulled to 1 nor to 0; it is effectively disconnected, so whatever else drives the wire decides its value.

Why are tri-state buffers used on buses?

Many devices share one bus wire. Each drives it through a tri-state buffer, and the control logic enables one at a time, so exactly one device drives the bus and the rest stay disconnected.

What is the difference between a tri-state buffer and a transmission gate?

Both can disconnect their output. A transmission gate only connects or disconnects two wires and passes the input's strength along; a tri-state buffer drives its output from the supply rails, so it restores the signal.

What happens if two tri-state buffers drive a bus at once?

If they drive different values, one pulls the wire up while the other pulls it down: a short from VDD to GND, called bus contention. The control logic must enable only one at a time.