Introduction
Logic gates are the building blocks of digital electronics. Every computer, smartphone, and calculator depends on them. A logic gate takes inputs, processes them, and gives a single output that follows a logical rule.
In this article, we’ll go step by step. First, we’ll see the truth tables. Then, we’ll look at transistor-level designs. Finally, we’ll connect them into circuits.
Focus keyphrase: Logic Gates
What Are Logic Gates?
Logic gates use binary signals. That means 0 (LOW, 0 volts) or 1 (HIGH, supply voltage like +5V).
There are seven basic logic gates:
- AND Gate
- OR Gate
- NOT Gate (Inverter)
- NAND Gate
- NOR Gate
- XOR Gate (Exclusive OR)
- XNOR Gate (Exclusive NOR)
1. AND Gate
Truth Table
| Input A | Input B | Output (A·B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Transistor Diagram (CMOS)
- Two PMOS transistors in parallel at the top (connected to Vcc).
- Two NMOS transistors in series at the bottom (connected to GND).
- When both inputs are HIGH, output goes HIGH.
Circuit Symbol
A flat-ended shape with two inputs on the left and one output on the right.
2. OR Gate
Truth Table
| Input A | Input B | Output (A+B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Transistor Diagram (CMOS)
- Two PMOS transistors in series at the top.
- Two NMOS transistors in parallel at the bottom.
- If any input is HIGH, output goes HIGH.
3. NOT Gate (Inverter)
Truth Table
| Input A | Output |
|---|---|
| 0 | 1 |
| 1 | 0 |
Transistor Diagram
- One PMOS and one NMOS transistor in series.
- If input is HIGH, PMOS is OFF, NMOS is ON → output = LOW.
- If input is LOW, PMOS is ON, NMOS is OFF → output = HIGH.
4. NAND Gate
Truth Table
| Input A | Input B | Output (¬(A·B)) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Diagram
It’s just an AND gate followed by a NOT gate.
👉 NAND is very important. Using only NAND gates, we can build all other gates.
5. NOR Gate
Truth Table
| Input A | Input B | Output (¬(A+B)) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Diagram
OR gate followed by NOT gate.
👉 NOR is also a universal gate.
6. XOR Gate
Truth Table
| Input A | Input B | Output (A⊕B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Explanation
- Output is HIGH only when inputs are different.
- Built from a combination of NAND, OR, and AND gates.
7. XNOR Gate
Truth Table
| Input A | Input B | Output (¬(A⊕B)) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Explanation
- Output is HIGH only when inputs are the same.
- Built from XOR + NOT.
How Logic Gates Become Circuits
- Half Adder: Uses an XOR and AND gate to add two bits.
- Full Adder: Expands half adder with carry input.
- Multiplexers, Flip-Flops, Counters: All are based on gates.
- CPUs: Billions of logic gates packed in microchips.
Why Transistor-Level Design Matters
Logic gates are not just abstract math. They are physical circuits.
Each gate is built from transistors. With CMOS (Complementary Metal Oxide Semiconductor), we combine PMOS and NMOS to reduce power loss.
This is why processors can run fast without overheating.
Applications of Logic Gates
- Electronics: Used in digital circuits.
- Computers: Perform binary math.
- Signal Processing: Filtering, decision making.
- IoT Devices: Embedded logic circuits.
- Robotics: Sensors and control systems rely on gates.
Final Thoughts
Logic gates are the foundation of modern electronics. From transistors to truth tables, they explain how 0s and 1s turn into powerful computation. If you understand them, you understand the base of computer science and physics combined.