A logic gate is a tiny machine with switches in and one lamp out, following one fixed rule: AND lights only if both switches are on, OR if either is. Chain millions together — each lamp flipping the next gate's switch — and you get a computer.
What's actually happening
In 1854, George Boole worked out an algebra where the only values are true and false — pure philosophy, with no machine in sight. Ninety years later it turned out to be the perfect blueprint for electronics: "true" is a high voltage, "false" a low one, and a handful of transistors can compute AND, OR, or NOT. A logic gate is Boole's algebra cast in silicon: inputs in, one rule applied, answer out, billions of times per second.
The gates compose. Feed gate outputs into gate inputs and the rules compound into arithmetic: an XOR gives you the sum digit of two bits, an AND gives you the carry — together they're a "half-adder", the first cell of real addition. Chain eight of those and you can add bytes; add memory loops (two NOR gates glaring at each other) and the circuit can remember. From there, step by step, you reach a CPU. Nothing smarter than AND/OR/NOT ever gets added — just more of them, better arranged.
The strangest fact in the field: one gate type suffices. Every other gate can be built from NANDs alone — NOT is a NAND with its inputs tied, AND is a NAND plus that NOT, and so on. A modern chip is, in a real sense, one idea repeated twenty billion times. The Apollo Guidance Computer that landed humans on the Moon was built almost entirely from a single 3-input NOR gate design — proof that with enough of one simple decision, you can navigate to another world.
- 1Get two coins (your input bits: heads = 1) and a friend, and add two one-bit numbers: 0+0, 0+1, 1+0, 1+1.
- 2You compute the XOR (call out 1 if the coins differ) — that's the sum digit. Your friend computes the AND (1 only for two heads) — that's the carry.
- 3Check 1+1: you say 0, your friend says 1 → binary "10" = two. You have, between you, performed the fundamental act of all computer arithmetic.