0 V1.353.154.5 V0no-go101ABresult0101NOTNOTANDANDOROR01switches128011064011032011016011084210110011001100110decimal0bit = value1 = true0 = falseA → NOT A0 → 11 → 0A B → AND0 0 → 00 1 → 01 0 → 01 1 → 1A B → OR0 0 → 00 1 → 11 0 → 11 1 → 11248163264128
Lit wire with moving dashes: it carries a 1Lamps: a glowing lamp is 1 (true), a dark one 0 (false)Place-value blocks and tokens: what each bit is worthTruth table: every input row and its resultA chip reads a wire as 0 when it is near 0 V and as 1 when it is near the supply; the gap between keeps noise from flipping a bit. Eight switches set eight bits; each lit lamp adds its place value (128 … 1) to the decimal value. The Boolean bench shows NOT, AND and OR with 1 as true. Binary place values are powers of two: 2⁰ = 1, 2¹ = 2, 2² = 4, 2³ = 8, up to 2⁷ = 128 in a byte. n bits have 2ⁿ patterns, so a byte holds 0 to 255 (Harris and Harris, Digital Design and Computer Architecture, section 1.4). George Boole set out his algebra of logic in An Investigation of the Laws of Thought (1854). In his master's thesis (written 1937, published 1938) Claude Shannon showed that the same algebra describes switching circuits, which is why chips are designed with it.

Why two states

  1. Inside a chip, every wire carries a voltage. Electrical noise nudges it up and down a little all the time. So a chip never needs an exact value. It only asks: is this wire near 0 V, or near the supply?

Counting in binary

Boolean logic

The numbers, step by step

;; step 1/11 · two-states
;; about: Voltage meter
supply (VCC)  4.5 V

near 0 V      → 0  (low)
near 4.5 V    → 1  (high)

Two states far apart are easy to tell
apart, even when the voltage wobbles.

Logic levels are from Texas Instruments' SN74HC00 datasheet at a 4.5 V supply: an input must be at least 3.15 V to count as 1 and at most 1.35 V to count as 0, while a lightly loaded output gives at least 4.4 V for 1 and at most 0.1 V for 0. That leaves a 1.25 V noise margin on each side. In Python, int("1011", 2) gives 11 and bin(11) gives '0b1011'. The words not, and, or are Boolean operators, and True == 1 is True because bool is a subtype of int.