Logic Gates - The Building Blocks of Digital Systems
đĄ What Are Logic Gates?â
Logic gates are the fundamental building blocks of all digital circuits. They take one or more input signals and produce a single output signal based on simple logical rules.
đ Basic Logic Gatesâ
NOT Gate (Inverter)â
The NOT gate takes a single input and inverts it. If the input is HIGH (1), the output is LOW (0), and vice versa.
| Input (A) | Output (NOT A) |
|---|---|
| 0 | 1 |
| 1 | 0 |
AND Gateâ
The AND gate takes two or more inputs and outputs HIGH only when all inputs are HIGH.
| Input A | Input B | Output (A AND B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR Gateâ
The OR gate takes two or more inputs and outputs HIGH when at least one input is HIGH.
| Input A | Input B | Output (A OR B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NAND Gate (NOT AND)â
The NAND gate is the opposite of AND. It outputs LOW only when all inputs are HIGH.
| Input A | Input B | Output (A NAND B) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
NOR Gate (NOT OR)â
The NOR gate is the opposite of OR. It outputs LOW when at least one input is HIGH.
| Input A | Input B | Output (A NOR B) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
XOR Gate (Exclusive OR)â
The XOR gate outputs HIGH when exactly one input is HIGH, but not both.
| Input A | Input B | Output (A XOR B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Logic gates are typically implemented using transistors. NAND and NOR gates are especially important because they are universal gates - you can build any other logic function using only NAND gates or only NOR gates! This property is widely used in integrated circuit design.
đ Classroom Exampleâ
You can demonstrate logic gates using simple switches and LEDs:
- AND Gate: Connect two switches in series with an LED. The LED only lights up when both switches are closed.
- OR Gate: Connect two switches in parallel with an LED. The LED lights up when either switch is closed.
This is a great hands-on way to teach basic logic!
đĄ Summaryâ
- Logic gates are the fundamental building blocks of digital circuits
- Basic gates: NOT, AND, OR, NAND, NOR, XOR
- Truth tables define the behavior of each gate
- Universal gates: NAND and NOR can build any logic function