part · Level 6 · Logic · active
What a CD4011 NAND gate chip does
CD4011 quad NAND — Four NAND gates in one 14-pin chip. Every other logic function can be built from these.
What it is
A logic gate is a circuit that answers a yes-or-no question about its inputs. It only knows two voltages: high, near the + supply, and low, near 0 V. Call them 1 and 0 and you have the alphabet every computer is written in.
A NAND gate asks "are both inputs high?" and then says the opposite: its output is low only when both inputs are high, and high the rest of the time. NAND is short for NOT-AND. The CD4011 packs four of these gates into one 14-pin chip, with a shared power pair: pin 14 is VDD (+) and pin 7 is VSS (−).
It belongs to the 4000 series of CMOS chips, which run on anything from 3 to 18 V, so your 4.5 V pack is fine, and whose inputs draw essentially no current. The price of that thrift is a weak output: it can light an LED, dimly, and that is about all.
How it works
Pins, anticlockwise from the notch: 1 A1, 2 B1, 3 Y1, 4 Y2, 5 A2, 6 B2, 7 VSS (−), 8 A3, 9 B3, 10 Y3, 11 Y4, 12 A4, 13 B4, 14 VDD (+). Gate 1 is pins 1, 2 → 3; gate 2 is 5, 6 → 4; gate 3 is 8, 9 → 10; gate 4 is 12, 13 → 11.
The truth table. Inputs A and B, output Y:
- 0, 0 → 1
- 0, 1 → 1
- 1, 0 → 1
- 1, 1 → 0
What counts as high. The chip compares each input with about half the supply: above 2.25 V on a 4.5 V pack is a 1, below is a 0. Inputs draw a few picoamps, so a 100 kΩ pull-down holds a pin at a firm 0 V and a button to + makes it a firm 1, costing 4.5 ÷ 100 000 = 45 µA while pressed.
Why NAND is "universal". Tie both inputs of one gate together and it becomes a NOT gate (1 → 0, 0 → 1). Feed one gate's output into a NOT and NAND becomes AND. NAND the outputs of two NOTs and you have OR. Every function in a processor can be built from NAND alone, which is why the Two-Key Lock, two gates making an AND, is the first logic circuit on this site.
What the output can drive. The datasheet rates a CD4011B output at roughly 1 mA at 5 V, measured with the output pulled 0.4 V off its rail; shorted into a load it manages a few milliamps and its voltage sags. The Workbench models the output as about 200 Ω to whichever rail it is driving, so a 220 Ω + red LED lane on 4.5 V shows (4.5 − 2.0) ÷ (200 + 220) ≈ 6 mA. Expect a real chip to give a dimmer LED, still clearly lit. For anything brighter or heavier, the output drives a transistor or MOSFET gate, which costs it no current at all.
Speed. About 100 ns from an input changing to the output following, at 5 V. Slow for a logic chip, instant for a human.
The numbers
| Gates | 4 × 2-input NAND |
|---|---|
| Supply | 3–18 V — pin 14 VDD, pin 7 VSS |
| Input threshold | ≈ half the supply — ≈ 2.25 V on 4.5 V |
| Input current | ≈ 0 — picoamps; 100 kΩ pull-downs are plenty |
| Output drive | ≈ 1 mA at 5 V — datasheet; sims model ≈ 200 Ω to the rail |
| Red LED on an output via 220 Ω | ≈ 6 mA (sim) — a real chip lights it dimmer |
| Propagation delay | ≈ 100 ns at 5 V |
See it working
The The Two-Key Lock circuit, simulated live. Open it on the Workbench to change anything.
simulating…
Mistakes everyone makes
- An unused input left floating. CMOS inputs drift to half-supply, where both halves of the gate conduct: the chip oscillates, gets warm and misbehaves. Fix: tie every unused input to VDD or VSS. The Two-Key Lock ties off gates 3 and 4.
- Chip in backwards. Pin 1 is next to the notch or dot; reversed power can kill it. Fix: check the notch before the battery.
- Expecting a bright LED. The output is weak. Fix: accept a dim LED for a signal, or have the output drive a MOSFET gate.
- A floating button input. A button to + with no pull-down leaves the pin undefined when released. Fix: 100 kΩ from the input to −.
- Static. It is a CMOS chip: a spark from your clothes can damage an input. Fix: touch earth first, store it in conductive foam.
Questions people ask
- What does NAND mean?
- NOT-AND. The output is the opposite of an AND gate: low only when every input is high, high otherwise.
- Why is NAND called a universal gate?
- Because NOT, AND, OR and every other logic function can be built from NAND gates alone. Tie the inputs together for NOT; add that NOT after a NAND for AND; NAND two inverted inputs for OR.
- What is the difference between a CD4011 and a 74HC00?
- Both are quad NAND gates in the same 14-pin footprint. The CD4011 runs from 3 to 18 V with weak outputs (about 1 mA). The 74HC00 is a 2–6 V family with outputs that drive about 20 mA, enough for an LED at full brightness, and it is faster.
Projects that use this part
- 🔐 The Two-Key Lock — Two NAND gates make an AND: the LED lights only while BOTH buttons are down. The first logic chip, and the reason NAND is called universal. L6 · 45 min
- 🚨 The Alarm That Remembers — Two NAND gates wired into each other make a memory. Tap SET and the red LED stays on after you let go, until someone presses RESET. L6 · 45 min
- 💡 The Two-Switch Hall Light — A light with a switch at each end of the hall: flip either and the light changes. Four NAND gates in one CD4011 make an XOR. L6 · 60 min
verified against: Texas Instruments — CD4011B quad 2-input NAND gate datasheet · SparkFun — Digital Logic · Kuphaldt — Lessons in Electric Circuits, Multiple-input Gates