Digital Electronics

NAND Gate: Truth Table, Universal Logic and CMOS Circuit

By CourseTron Team ·  6 min read 💬 𝕏 in f

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?

    Two-input NAND truth table
    ABA AND BNAND
    0001
    0101
    1001
    1110

    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))
    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.

    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.

    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.

    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.

    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.

    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

    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.

    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

    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.