A NAND gate is an AND function followed by inversion: Y=NOT(A AND B). For two binary inputs, its output is 0 only for A=B=1. NAND is universal because networks of NAND gates can implement every Boolean function.
Reviewed 12 November 2026 · Binary examples checked with executable tests.
On this page
What is the NAND truth table?
| A | B | A AND B | NAND |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
Keep the inversion outside the complete AND expression. NOT(A AND B) is not the same expression as (NOT A) AND B. De Morgan gives NOT(A AND B)=(NOT A) OR (NOT B).
How do NAND gates build other functions?
Use the same signal on both inputs to make an inverter. Invert a NAND result to get AND. To make OR, invert each input and feed those results into a final NAND.
NOT A = NAND(A, A)
A AND B = NAND(NAND(A,B), NAND(A,B))
A OR B = NAND(NAND(A,A), NAND(B,B))These identities establish functional completeness. They do not say that a NAND-only implementation is always fastest or smallest. A synthesis tool may use complex cells, shared inversions and different factorizations to meet constraints.
What does the static-CMOS NAND network look like?
A conventional two-input static-CMOS NAND uses two PMOS pull-up devices in parallel and two NMOS pull-down devices in series. When both inputs are high, the pull-up devices are off and both series NMOS devices conduct. With either input low, the series path is interrupted and a corresponding pull-up device conducts.
This explanation describes the ideal valid-level steady states. During a transition, currents, capacitance and device strengths affect the output waveform. Transistor count alone does not determine propagation delay or power.
How does feedback turn NAND gates into a latch?
Two cross-coupled NAND gates form an SR latch with active-low set and reset inputs, commonly written S̅ and R̅. Both controls high means hold. S̅=0 and R̅=1 sets Q; S̅=1 and R̅=0 resets Q. Driving both low forces both outputs high and is not a valid complementary stored state.
The polarity is essential: the active-high NOR latch has a different input table. Use the SR latch and flip-flop guide to compare them. A NAND gate without feedback is combinational; the feedback connection introduces state.
What should you verify before using a physical part?
A two-input truth table is only the start. Check the exact device's supply range, input thresholds, drive capability, package pinout and delay conditions. Tie unused inputs to a defined permitted level using the manufacturer's guidance; an ideal software model cannot reveal a floating physical input.
The lab verifies NAND identities and the four-NAND XOR network over all binary inputs. For a reference table across other gate types, use logic-gate truth tables.
Additional circuit views
Common questions
Why is NAND called a universal gate?
You can construct NOT, AND and OR using NAND gates. Those functions are sufficient to build arbitrary Boolean logic, so NAND alone is functionally complete.
How many inputs can NAND have?
NAND is not restricted to two inputs. An n-input NAND is low when all n inputs are high, but the available device or cell and its electrical limits must be checked.
Is a NAND latch clocked?
The basic cross-coupled NAND SR latch has no clock. Gating its inputs can add an enable function; edge-triggered storage requires additional structure.
References and checks
- Texas Instruments: SN74HC00 NAND product and datasheet
- Texas Instruments: SN74LS279A active-low SR latch datasheet
Download the functional tests and model source. These check stated binary functions; they do not establish analog timing, physical implementation, fault coverage or board behavior.