Study smarter with Fiveable
Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.
Logic gates are the fundamental building blocks of every digital system, from simple circuits to complex processors. Understanding them goes beyond memorizing which input combinations produce which outputs. You need to grasp the underlying Boolean algebra principles, gate universality, and how gates combine to perform logical operations. These concepts form the foundation for circuit simplification, combinational logic design, and eventually sequential logic.
The truth tables encode the logical behavior that makes digital electronics predictable and designable. Understanding the relationships between gates lets you analyze circuits quickly and choose the right gate for any application. Don't just memorize the tables; know why each gate behaves the way it does and when you'd reach for one gate over another.
These three gates represent the fundamental Boolean operations. Every other gate can be built from some combination of AND, OR, and NOT.
The AND gate outputs 1 only when all inputs are 1. Think of it as a "both must be true" check, which makes it perfect for condition-checking circuits.
| A | B | |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
The OR gate outputs 1 when any input is 1. It's the "at least one true" gate, ideal for combining multiple trigger conditions into a single output.
| A | B | |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
The NOT gate outputs the complement of its single input. It's the only basic gate with just one input.
| A | |
|---|---|
| 0 | 1 |
| 1 | 0 |
Compare: AND vs. OR. Both take two inputs, but AND needs all inputs high while OR needs any input high. A quick pattern to remember: AND's truth table has three 0s and one 1; OR's has three 1s and one 0. They're almost mirror images of each other.
A universal gate is one that can, by itself, implement any Boolean function. That means you can build AND, OR, NOT, and every other gate using only NAND gates, or using only NOR gates. This matters for IC design because manufacturing a chip with a single gate type simplifies fabrication.
The NAND gate outputs 0 only when all inputs are 1. It's literally an AND followed by a NOT, hence "NOT-AND."
| A | B | |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
To make a NOT gate from a NAND: tie both inputs together. When , . When , . That's inversion.
The NOR gate outputs 1 only when all inputs are 0. It's an OR followed by a NOT, hence "NOT-OR."
| A | B | |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
To make a NOT gate from a NOR: same trick, tie both inputs together. When , . When , .
Compare: NAND vs. NOR. Both are universal and both have inverted outputs, but their truth tables are complements. NAND outputs three 1s and one 0; NOR outputs one 1 and three 0s. Know how to build a NOT from each (tie both inputs together), and you'll be set for universality questions.
These gates care about whether inputs match or differ, which makes them essential for comparison operations, arithmetic circuits, and error detection.
The XOR gate outputs 1 when the inputs are different. Unlike OR, it outputs 0 when both inputs are 1.
| A | B | |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
The XNOR gate outputs 1 when the inputs are the same. It functions as an equality detector.
| A | B | |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Compare: XOR vs. XNOR are exact complements. XOR asks "are they different?" while XNOR asks "are they the same?" Both output two 1s and two 0s, just in opposite positions. For binary addition, XOR gives you the sum bit; for equality checking, XNOR is your gate.
| Concept | Best Examples |
|---|---|
| Outputs 1 for single condition | AND (all inputs 1), NOR (all inputs 0) |
| Outputs 0 for single condition | OR (all inputs 0), NAND (all inputs 1) |
| Universal gates | NAND, NOR |
| Inverted versions | NAND (inverted AND), NOR (inverted OR), XNOR (inverted XOR) |
| Difference detection | XOR |
| Equality detection | XNOR |
| Single-input operation | NOT |
| Used in binary addition | XOR (sum bit), AND (carry bit) |
Which two gates are considered universal, and what does "universal" mean in this context?
Compare the truth tables of AND and NAND. How many output values differ between them, and why?
If you need a gate that outputs 1 only when two input signals are different, which gate would you choose? What if you needed the opposite behavior?
Using Boolean expressions, explain why and produce the same truth table. Which theorem does this demonstrate?
You're designing a circuit that should activate an alarm when either sensor A or sensor B detects motion, but not when both detect motion simultaneously. Which single gate implements this logic? Write out the truth table to verify your answer.