Binary Logic
Binary logic is the use of exactly two states, true and false or 1 and 0, to represent information and to compute with it, and in electronics those two states are carried by two distinguishable voltage ranges: a low level and a high level. Every digital computer, phone and network chip is built on it. The central idea is that the circuit does not need to know exactly what voltage it sees, only which side of a threshold it lies on, and that humble question is far easier to answer reliably than reading off a precise analog value.
The mapping from voltage to logic value is a set of guaranteed ranges, with a forbidden gap between them. In classic 5-volt TTL (transistor-transistor logic) a gate output is guaranteed to be at most about 0.4 volts when low and at least about 2.4 volts when high, while an input is read as low below about 0.8 volts and as high above about 2.0 volts. The difference between what a driver promises and what a receiver demands is the noise margin, about 0.4 volts at both levels here. Standard 5-volt CMOS puts its input thresholds at roughly 30 and 70 percent of the supply, and its outputs swing nearly all the way to the rails, so its noise margins are larger. Modern chips use supplies of about 1 volt or less, so the absolute numbers are smaller, but the principle is unchanged: signals between the thresholds are illegal and are transient, passed through only during a switch.
Binary is robust because every gate restores the signal. An analog signal that picks up noise carries the error forward, and each further stage adds more. A digital gate takes an input that is somewhat degraded, as long as it is on the right side of the threshold, and produces a clean full-swing output, so noise does not accumulate. This regeneration is why a chip can chain billions of operations with essentially no accumulated error, why data can be copied with perfect fidelity, and why error-correcting codes can push reliability even further. The cost is that a quantity needing many levels must be encoded in many bits, and the speed and power of each gate are limited by the need to swing across a large voltage range.
Claude Shannon connected the abstract algebra to hardware in 1937. While a master's student at MIT, he showed in his thesis, A Symbolic Analysis of Relay and Switching Circuits, that the behavior of networks of relays and switches could be written and simplified using Boolean algebra: switches in series behave as AND, switches in parallel as OR, and a normally closed contact as NOT. That turned circuit design from trial and error into algebra, since an expression could be simplified on paper and the corresponding circuit would use fewer parts. The same mapping carried over unchanged when relays gave way to tubes and then transistors, and it is the reason logic design is still taught in terms of Boolean expressions and truth tables.
Binary is a design choice, not a law of nature, and other options have been tried. Early machines such as ENIAC calculated in decimal using ring counters of tubes, and a few designs, including the Soviet Setun computer of the late 1950s, used three-valued balanced ternary. Multi-level cells in flash memory store two, three or four bits per cell by distinguishing 4, 8 or 16 charge levels, trading noise margin for density and requiring error correction. Some signaling standards, such as PAM4 on fast serial links, send four voltage levels to double the bits per symbol. A frequent misconception is that a computer literally knows 0 and 1 as numbers; the hardware only has a voltage above or below a threshold, and its meaning as a bit is supplied by the design around it.
The pitfalls of binary logic live at the boundary with the analog world. A signal changing near its threshold at the instant it is sampled can leave a flip-flop undecided for a short, unpredictable time, a condition called metastability, so signals crossing between unsynchronized clocks pass through synchronizer circuits. Long wires, shared power rails and fast edges inject noise that eats the margin, which is why chips include careful power distribution, shielding and termination.
Read binary logic as the agreement that turns a messy, continuous physical quantity into a clean yes-or-no: a convention enforced by threshold, noise margin and regeneration at every gate, which allowed vast systems of unreliable parts to compute with essentially perfect results.