digiwleeaLearn
Open the lab →

Build the inverter

Two transistors, traced row by row

5 min read

A CMOS inverter is built from one PMOS connecting the output to power and one NMOS connecting it to ground, both driven by the same input, so a 0 turns on the PMOS (output 1) and a 1 turns on the NMOS (output 0).

Build it in the lab →
Time to wire a real gate. The inverter is the smallest complementary pair, so it is the cleanest place to watch the complementary principle play out transistor by transistor. Its pull-down is a single NMOS and its pull-up is a single PMOS, the simplest possible dual (one transistor swapped for one transistor). This is the same gate the NOT lesson treats as a logic function; here the focus is purely on the two transistors and the voltage on the output node.

Place the two transistors

  1. Pull-up (PMOS) on top: its source to VCC, its drain to the output node F, its gate to the input A. This is the whole pull-up network, one transistor.
  2. Pull-down (NMOS) below: its drain to the output node F, its source to GND, its gate to the input A. This is the whole pull-down network, one transistor.
  3. Tie the two gates together to the single input A, and take the output off the shared node F between them. That is the entire circuit: two transistors, one input, one output.

Trace it: A = 0

Drive A to 0. The PMOS gate sees 0, so the PMOS conducts, connecting F to VCC. The NMOS gate also sees 0, so the NMOS is off, leaving F disconnected from GND. The only live path is up to VCC, and the PMOS delivers a full strong 1. So A = 0 gives F = 1.

Trace it: A = 1

Now drive A to 1. The NMOS gate sees 1, so the NMOS conducts, connecting F to GND. The PMOS gate sees 1, so the PMOS is off. The only live path is down to GND, and the NMOS delivers a full strong 0. So A = 1 gives F = 0. In both cases exactly one transistor is on, so there is never a short and never a float, and each transistor is used on its strong side.
APMOSNMOSF
0onoff1
1offon0
The inverter traced. On each row exactly one transistor conducts and drives F to the opposite rail from A. That is the NOT function.
PMOS on top to VCC, NMOS below to GND, both gates on input A, output F between them. Open it in the lab and toggle A: exactly one transistor lights up and F flips to the opposite value.
Notice the pull-up is the exact dual of the pull-down here in the simplest possible way: a single series element becomes a single series element (there is nothing to swap with one transistor). Every larger gate is this same idea with more transistors in each network. Master the trace on two transistors and the four-transistor gates are just more of the same bookkeeping.
The single trick that makes it an inverter is that both gates share the one input A. Wire the two gates to different signals and you no longer have a NOT: you have the start of a two-input gate. And swapping the transistors (NMOS on top, PMOS on the bottom) would put each device on its weak side and produce degraded, leaky levels, not a clean inverter. PMOS pulls up, NMOS pulls down, always.
Try it
Build the inverter in the lab and confirm both rows. Then predict: if you accidentally tied the NMOS gate to GND (a permanent 0) while the PMOS gate still follows A, what would the output do when A = 1?
Build it in the lab ↗

Frequently asked

How do you build an inverter from transistors?

Put one PMOS between the power supply and the output and one NMOS between the output and ground, and tie both gates to the same input. At input 0 the PMOS conducts and the output is 1; at input 1 the NMOS conducts and the output is 0. Exactly one transistor is ever on.

Why does a CMOS inverter need both a PMOS and an NMOS?

So the output is always driven on its strong side. The PMOS pulls the output up to a full 1 when the input is 0, and the NMOS pulls it down to a full 0 when the input is 1. Using both, wired as a complementary pair, gives clean full-rail output with no short and no floating.

What happens if both transistors in an inverter shared the same rail?

It would break. The inverter works because the PMOS reaches up to VCC and the NMOS reaches down to GND, so together they cover both output values. Swapping them, or wiring the gates to different signals, gives degraded levels or a floating output instead of a clean inversion.
Next: add a second transistor to each network and build the two workhorse gates, NAND and NOR, watching the duality flip between them.

You've got the theory. Now build it from scratch and watch it work.

Build it in the lab →
Found this useful? Share itShare on X