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 building blocks of digital computation. Every processor, memory chip, and circuit is built from combinations of seven fundamental operations. In Discrete Mathematics, you need to translate fluently between Boolean expressions, truth tables, and gate diagrams, and to break complex logical statements into simpler operations. Gates also connect directly to proof techniques, set operations, and propositional logic.
Don't just memorize what each gate does. Know why certain gates are called universal, how compound gates relate to their primitive components, and when to apply each gate in Boolean simplification problems. Exams will ask you to evaluate expressions, construct equivalent circuits, and identify which gate produces a specific truth table pattern.
These three gates form the foundation of Boolean algebra. Every other gate can be constructed from combinations of AND, OR, and NOT. Master these first, and the compound gates become intuitive.
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Compare: AND vs. OR are both binary operations, but AND requires all conditions (outputs mostly 0s) while OR requires any condition (outputs mostly 1s). If a truth table has three 1s out of four rows, that's OR. One 1 out of four rows means AND.
NAND and NOR are called universal gates because either one alone can construct AND, OR, NOT, and therefore any Boolean function. This property makes them crucial for circuit minimization and hardware design.
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Compare: NAND vs. NOR are both universal and both invert a basic gate, but NAND defaults to outputting 1s (permissive) while NOR defaults to outputting 0s (restrictive). To implement NOT using either gate type, connect both inputs together: , and .
XOR and XNOR detect whether inputs match or differ. These gates are essential for arithmetic circuits, error detection, and comparison operations in digital systems.
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Notice that XOR and OR produce the same output for three of the four input combinations. They only differ at (1,1): OR gives 1, XOR gives 0.
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Compare: XOR vs. XNOR are perfect complements. XOR detects difference (odd parity), XNOR detects sameness (even parity). For multi-bit equality checking, XNOR each pair of bits and AND all the results together.
| Concept | Best Examples |
|---|---|
| Basic operations | AND, OR, NOT |
| Universal gates | NAND, NOR |
| Compound gates (inverted basic) | NAND, NOR, XNOR |
| Parity detection | XOR (odd), XNOR (even) |
| Most restrictive output | AND (one 1), NOR (one 1) |
| Most permissive output | OR (one 0), NAND (one 0) |
| Equality checking | XNOR |
| Arithmetic operations | XOR (addition), AND (carry) |
Which two gates are universal, and what does "universal" mean in this context?
Given a truth table with outputs (1, 1, 1, 0) for inputs (0,0), (0,1), (1,0), (1,1), which gate does this represent?
Compare and contrast XOR and OR: when do they produce the same output, and when do they differ?
How would you construct a NOT gate using only NAND gates? What about using only NOR gates?
If you need to design a circuit that outputs 1 only when two input bits are equal, which single gate accomplishes this, and what Boolean expression represents it?