UNIT B.5 — COMPUTING

Boolean algebra and logic gates

BRIDGE · EE Foundations Bridge · ~10 min

Community content — not verified by a licensed electrician. Lessons and questions here are written for study practice and pinned to NEC 2023. Code editions and local amendments vary by jurisdiction. Always confirm against your adopted code book and your licensing board's published exam outline before test day.

Boolean algebra is math with only two values: 1 (true, on, energized) and 0 (false, off, dead). Three operations build everything: AND (output 1 only if all inputs are 1), OR (output 1 if any input is 1), NOT (invert). A truth table lists the output for every input combination — the digital equivalent of a wiring diagram.

You have wired Boolean logic already. Two switches in series feeding a load is an AND gate — both must close. Two switches in parallel is OR — either one energizes the load. Your 3-way switch circuit (Sandbox exercise 03) is an XOR in disguise: the light state flips whenever either switch flips.

One more idea unlocks computing: NAND (AND then NOT) is *universal* — any logic function whatsoever can be built from NAND gates alone. Chain millions of them and you have a processor. That is not a metaphor; it is literally how CPUs are constructed.

Go deeper: MIT's Computation Structures, and the famous Nand2Tetris course where you build a working computer starting from NAND gates — Semesters 1 and 3 of the Go Deeper pathway.

AND
Switches in series
OR
Switches in parallel
NAND
Universal gate
Knowledge check

Quiz — 3 questions

1. Two switches wired in series feeding a lamp implement:

2. An OR gate outputs 0 only when:

3. NAND is called a universal gate because:

← SyllabusNext: Programming fundamentals →