What Are Logic Gates?
ElectronicsA complete guide to the fundamental building blocks of digital circuits.
Introduction to Logic Gates
A logic gate is an idealized or physical device implementing a Boolean function. It performs a logical operation on one or more binary inputs to produce a single binary output. Logic gates are the fundamental building blocks of all digital circuits, from simple calculators to complex computer processors.
The Seven Basic Logic Gates
1. AND Gate
The output is HIGH (1) only when all inputs are HIGH.
- Symbol: A · B or AB
- Truth Table: 0·0=0, 0·1=0, 1·0=0, 1·1=1
2. OR Gate
The output is HIGH when at least one input is HIGH.
- Symbol: A + B
- Truth Table: 0+0=0, 0+1=1, 1+0=1, 1+1=1
3. NOT Gate (Inverter)
The output is the opposite of the input.
- Symbol: Ā or ~A
- Truth Table: ~0=1, ~1=0
4. NAND Gate
A combination of AND + NOT. Output is LOW only when all inputs are HIGH.
Fun fact: NAND gates are "universal" — any other gate can be built using only NAND gates!
5. NOR Gate
A combination of OR + NOT. Output is HIGH only when all inputs are LOW.
6. XOR Gate (Exclusive OR)
Output is HIGH when inputs are different.
- Truth Table: 0⊕0=0, 0⊕1=1, 1⊕0=1, 1⊕1=0
7. XNOR Gate (Exclusive NOR)
Output is HIGH when inputs are the same.
Real-World Applications
- Adders — XOR gates are used in binary addition circuits
- Memory — Flip-flops use NAND or NOR gates to store data
- CPUs — Billions of logic gates work together in modern processors
- Encryption — XOR operations are fundamental to many encryption algorithms
Try It Yourself
Use our Scientific Calculator to experiment with boolean operations, or check out the Periodic Table for more reference materials.