Digital Electronics

NAND Gate

By CourseTron Team ·  6 min read ·  Updated Oct 2026 💬 𝕏 in f
Table of Contents
    ? Print / Save as PDF

    In short: The NAND gate is a universal gate because any Boolean function — every other gate, adder, or flip-flop — can be built from NAND alone, and in CMOS it is the cheapest, fastest building block a foundry offers.

    Ask any VLSI interviewer to name the single most important logic primitive and the answer is almost always NAND. It is the gate standard-cell libraries optimize first, the gate SPICE characterizes most carefully, and the one every digital designer should be able to draw at the transistor level from memory. This article explains why NAND earns that status: its truth table, its four-transistor CMOS realization, and the constructive proofs that let it synthesize NOT, AND, OR, XOR and even sequential memory.

    The NAND truth table and Boolean definition

    NAND is simply AND followed by inversion: its output is LOW only when every input is HIGH. For two inputs A and B the Boolean expression is Y = (A·B)', read "not A-and-B". The honest way to internalize it is that NAND outputs 1 unless forced to 0 by an all-ones input.

    2-input NAND truth table
    ABA·BY = (A·B)'
    0001
    0101
    1001
    1110

    By De Morgan's theorem, (A·B)' = A' + B'. That identity is the engine behind NAND's universality: a single NAND behaves as an OR of inverted inputs, which is exactly what you need to flip between AND-form and OR-form logic during synthesis.

    Why NAND is a universal gate

    A gate is "universal" (functionally complete) if you can build the complete set {NOT, AND, OR} from it, because those three suffice for any Boolean function via its sum-of-products form. Here is the constructive proof using only NAND:

    • NOT: tie both inputs together — NAND(A,A) = (A·A)' = A'.
    • AND: NAND then invert — AND(A,B) = NAND( NAND(A,B), NAND(A,B) ). Two NANDs.
    • OR: invert each input, then NAND — OR(A,B) = NAND(A', B') = NAND( NAND(A,A), NAND(B,B) ). Three NANDs.

    Because {NOT, AND, OR} is complete and all three come from NAND, NAND alone is complete. NOR shares this property, but NAND wins in practice for a transistor-physics reason covered below. For the broader picture of which primitives are complete and why, see our companion piece on universal logic gates.

    Building NOT, AND and OR from NAND gates onlyNOT = 1 NANDNANDAA'AND = 2 NANDNANDNANDABA·BOR = 3 NANDNANDNANDNANDABA+BDe Morgan: (A'·B')' = A+BCourseTron · coursetron.com
    Every basic gate reconstructed from NAND only — the heart of functional completeness.

    CMOS implementation: four transistors, no more

    A 2-input static CMOS NAND needs just four transistors: two PMOS in parallel forming the pull-up network (PUN) and two NMOS in series forming the pull-down network (PDN). The output is pulled LOW only when both NMOS conduct — i.e. both inputs are HIGH — which is precisely the NAND condition. For any other input combination at least one PMOS is on, so the output is pulled HIGH.

    Static CMOS 2-input NANDVDDPMOS (A)PMOS (B)YNMOS (A)NMOS (B)GNDPull-up network:PMOS in parallelPull-down network:NMOS in seriesY = 0 only whenA = B = 1CourseTron · coursetron.com
    Static CMOS 2-input NAND: parallel PMOS pull-up, series NMOS pull-down.

    NAND beats NOR in silicon because electron mobility (NMOS) is roughly 2–3× hole mobility (PMOS). NAND stacks the slow devices (PMOS) in parallel and the fast ones (NMOS) in series, so its worst-case delay is smaller than NOR's for the same area. That is why a foundry's lowest-drive-strength cell is usually an inverter, then NAND2.

    Animated: the series NMOS pull-down in action

    Series NMOS pull-down: Y falls only when A = B = 1GNDNMOS (A)NMOS (B)YA = 0 or B = 0:series path is openY stays HIGH (1)A = 1 and B = 1:both NMOS conductY pulled LOW (0)CourseTron · coursetron.com
    When both inputs go HIGH, both series NMOS conduct and the output charge drains to ground.

    From NAND to flip-flops: building memory

    Universality is not limited to combinational logic. Cross-couple two NAND gates — feed each gate's output back into the other's input — and you get an SR latch (specifically the active-LOW S'R' latch). This bistable element is the seed of all static memory. Add a clock-gated front end of two more NANDs and you have a gated D latch; cascade a master and a slave latch and you have an edge-triggered D flip-flop, the workhorse register in every synchronous SoC. A standard positive-edge D flip-flop is commonly drawn as six NAND gates.

    This matters in real flows: when Synopsys Design Compiler or Cadence Genus maps your RTL, it is choosing among library cells that were themselves characterized down to NAND-level transistor behavior, and Siemens EDA Questa simulates the resulting netlist at that granularity. Understanding the NAND latch is how you reason about setup/hold timing and metastability rather than treating the flop as a black box. For sequential depth, continue with our guide to SR latch to flip-flop.

    Cross-coupled NAND SR latch (active-LOW inputs)NANDNANDS'R'QQ'S'=0, R'=1: set (Q=1)S'=1, R'=0: reset (Q=0)S'=R'=1: holdCourseTron · coursetron.com
    Two cross-coupled NAND gates form an active-LOW SR latch: S'=0 sets Q, R'=0 resets Q, both HIGH holds.

    If you want hands-on silicon design practice building these cells and timing them, our partners at ChipXpert's VLSI training run lab exercises on exactly this foundation.

    Ready to master logic design from transistors to tapeout? Explore the full CourseTron Digital Electronics and VLSI courses and build NAND-level intuition that holds up in any interview.

    Frequently asked questions

    Is NAND or NOR the better universal gate?

    Both are functionally complete. NAND is preferred in CMOS because its pull-down network uses fast series NMOS while slow PMOS sit in parallel in the pull-up, giving lower delay and smaller area than NOR for equal drive strength.

    How many transistors are in a 2-input NAND?

    Four: two PMOS in parallel (pull-up) and two NMOS in series (pull-down). A 3-input NAND uses six, and so on — one PMOS and one NMOS per input.

    How do you make a NOT gate from a NAND?

    Tie both NAND inputs together. NAND(A,A) = (A·A)' = A', which is exactly inversion.

    Why is NAND called universal?

    Because you can construct NOT, AND, and OR — a functionally complete set — using NAND gates alone, so any Boolean expression, combinational or sequential, can be realized with NANDs only.

    Advertisement