What Are Logic Gates?
Logic gates are small parts inside computers.
They take 0s and 1s (off and on signals) and make decisions.
They are the base of all computers, phones, and digital technology.
Common Logic Gates
| Gate | What It Does | Example Impact |
|---|---|---|
| AND | 1 only if both are 1 | Keycard and PIN needed to enter |
| OR | 1 if at least one is 1 | Automatic door (motion or button) |
| NOT | Flips the input (0→1, 1→0) | Thermostat turns off at a set temperature |
| NAND | Opposite of AND | Self-driving car decisions |
| NOR | Opposite of OR | Self-driving car safety checks |
| XOR | 1 if inputs are different | Computer memory checking |
| XNOR | 1 if inputs are the same | Pattern recognition |
Quick Truth Tables
AND Gate
| A | B | A AND B | |:-:|:-:|:——-:| | 0 | 0 | 0 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 |
OR Gate
| A | B | A OR B | |:-:|:-:|:——:| | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 1 |
NOT Gate
| A | NOT A | |:-:|:—–:| | 0 | 1 | | 1 | 0 |
NAND and NOR Gates
| A | B | NAND (not AND) | NOR (not OR) | |:-:|:-:|:————-:|:————:| | 0 | 0 | 1 | 1 | | 0 | 1 | 1 | 0 | | 1 | 0 | 1 | 0 | | 1 | 1 | 0 | 0 |
XOR Gate
| A | B | A XOR B | |:-:|:-:|:——-:| | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 |
XNOR Gate
| A | B | A XNOR B | |:-:|:-:|:——–:| | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 |
Summary
Logic gates are tiny circuits that help computers make decisions using simple yes/no (on/off) rules.
They are used in security systems, robots, memory chips, and even traffic lights.