Course contentsShow
← Computer Science
Lesson 18 of 2,8721. Digital FoundationsFree lesson

NAND and NOR Gates

Learning universal gates NAND and NOR that can implement any boolean function.

NAND and NOR Gates

What you'll learn: You'll discover two special "universal" gates that can build ANY logic circuit by themselves.

Why NAND and NOR Are Special

So far you've learned NOT, AND, OR, and XOR gates. Now meet the power duo: NAND and NOR. These gates are called universal gates because each one can create every other gate you've learned. That's like having a Swiss Army knife that replaces your entire toolbox!

The NAND Gate

NAND means "NOT AND" — it's an AND gate followed by a NOT gate.

Truth Table:

A | B | NAND
0 | 0 |  1
0 | 1 |  1
1 | 0 |  1
1 | 1 |  0

Notice it's the opposite of AND. It only outputs 0 when both inputs are 1.

Analogy: Think of two safety switches on dangerous machinery. The machine runs (outputs 0) ONLY when both switches are pressed. Otherwise it stays off (outputs 1) — safer by default!

The NOR Gate

NOR means "NOT OR" — it's an OR gate followed by a NOT gate.

Truth Table:

A | B | NOR
0 | 0 |  1
0 | 1 |  0
1 | 0 |  0
1 | 1 |  0

It's the opposite of OR. It only outputs 1 when both inputs are 0.

Why They're Universal

Using only NAND gates (or only NOR gates), you can build:

  • A NOT gate (connect both inputs together)
  • An AND gate (NAND followed by NOT)
  • An OR gate (combine NANDs cleverly)
  • Any complex circuit!

This matters in real computer chips: manufacturers can mass-produce just one type of gate and build everything from it.

Key Takeaway: NAND and NOR are universal gates—each can implement any boolean function, making them the building blocks of all digital circuits.