Logic gates AND OR NOT NAND NOR — truth tables and Boolean expressions

easy CBSE JEE-MAIN NCERT Class 12 4 min read

Question

Write the truth tables and Boolean expressions for the five basic logic gates: AND, OR, NOT, NAND, and NOR. Explain why NAND and NOR are called universal gates.

(NCERT Class 12, Chapter 14)


Solution — Step by Step

AND Gate: Output is 1 only when both inputs are 1.

ABY = A·B
000
010
100
111

OR Gate: Output is 1 when at least one input is 1.

ABY = A+B
000
011
101
111

NOT Gate: Output is the complement of the input. Y=AY = \overline{A}.

AY
01
10

NAND Gate (NOT + AND): Y=ABY = \overline{A \cdot B}

ABY
001
011
101
110

NOR Gate (NOT + OR): Y=A+BY = \overline{A + B}

ABY
001
010
100
110

A gate is universal if it alone can be used to build AND, OR, and NOT gates (and therefore any logic circuit).

NAND as universal:

  • NOT: Connect both inputs of NAND together → AA=A\overline{A \cdot A} = \overline{A}
  • AND: NAND followed by NOT (another NAND with tied inputs)
  • OR: Apply NOT to each input, then NAND

NOR as universal: Similarly, NOR alone can implement all three basic gates.

Since any Boolean function can be built from AND, OR, NOT — and these can be built from NAND (or NOR) alone — NAND and NOR are universal.


Why This Works

Logic gates are the building blocks of all digital circuits — from calculators to smartphones. Each gate implements a simple Boolean operation on binary inputs (0 or 1). By combining these gates, we can build circuits that perform arithmetic, store data, and make decisions.

The universality of NAND gates is why they dominate IC manufacturing — a single type of gate can implement any logic function, simplifying production.


Alternative Method — De Morgan’s Theorems for Quick Conversions

AB=A+B(NAND = OR of complements)\overline{A \cdot B} = \overline{A} + \overline{B} \quad \text{(NAND = OR of complements)} A+B=AB(NOR = AND of complements)\overline{A + B} = \overline{A} \cdot \overline{B} \quad \text{(NOR = AND of complements)}

For JEE/CBSE, memorise De Morgan’s theorems cold. They let you convert any NAND/NOR expression into AND/OR form instantly. The most common exam question: “Identify the equivalent gate” — where they give a combination of NAND/NOR gates and ask what single gate it implements.


Common Mistake

Students swap the truth tables of NAND and NOR. Quick check: NAND gives 0 only when both inputs are 1 (it’s the opposite of AND). NOR gives 1 only when both inputs are 0 (it’s the opposite of OR). If you remember “NAND = inverted AND” and “NOR = inverted OR”, you’ll never mix them up.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next