The Alphabet of Hardware
Digital circuits compute with just two voltage levels, interpreted as boolean values 1 (true, high) and 0 (false, low). Every digital operation is built from logic gates, hardware elements computing a boolean function.
| Gate | Output is 1 when... |
|---|---|
| AND | all inputs are 1 |
| OR | at least one input is 1 |
| NOT | the single input is 0 |
| NAND | inverse of AND (0 only if all are 1) |
| NOR | inverse of OR (1 only if all are 0) |
| XOR | the inputs differ |
NAND is universal: any boolean function can be built using only NAND gates (NOR is also universal). Gates are physical atoms; everything from an adder to a processor is built by wiring them together.
OR vs. XOR & Formula
Common pitfall: confusing OR with XOR. OR outputs 1 when at least one input is 1, including when both are 1. XOR (exclusive-OR) outputs 1 only when inputs differ ().
For inputs (1, 1), OR glows (1) but XOR stays dark (0). Watch this "both are 1" edge case where they disagree.
The formal definition for XOR is:
where and are boolean variables, denotes XOR, and means "if and only if."