In the game, this was light switches in a roomPlay “Light Up the Room”
| In the game | In real IT |
|---|---|
| Switch on / off | 1 and 0 |
| Series wiring | AND |
| Parallel wiring | OR |
| Stair switches (top and bottom) | XOR |
| Fridge door switch | NOT |
| Switch-and-light table | Truth table |
The four basic gates
- AND (logical product): 1 only when both are 1. A safe that opens when both of its keys are turned
- OR (logical sum): 1 if either is 1. A doorbell that rings from either the front or the back-door button
- NOT (negation): flips 0 and 1
- XOR (exclusive OR): 1 when the two differ. It works like the light switches at the top and bottom of a staircase (two-way switches)
AND and OR with their results flipped by NOT are called NAND and NOR. You can build any circuit by combining NAND gates alone.
A truth table lists every pattern
A truth table lists every combination of inputs and the output for each. Two inputs give 4 rows, three give 8 (2 to the power n). If two tables are exactly the same, the circuits do the same job even if their insides differ.
Addition can be built from gates
| A | B | S (lower digit) | C (carry) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
In 1-digit binary addition, the S column is the same as XOR and the C column the same as AND. This circuit is called a “half adder”; join two and add an OR, and you get a “full adder” that can add a carry too. A CPU’s arithmetic is rows of these.
How the FE exam asks it
Common questions ask you to read a circuit diagram (MIL symbols) and give the output, or to pick the logical expression that matches a truth table. In expressions, AND is written A·B, OR as A+B, NOT as a bar over A, and XOR as A⊕B.
- AND = both 1, OR = either 1, XOR = 1 if different, NOT = flip
- A truth table lists every input pattern (n inputs → 2 to the power n rows)
- Addition is built from XOR (lower digit) and AND (carry)