;colony/science  / Computers, Visually  / Logic gates
Computers, Visually · No. 52 of the first 100

Logic gates

Your laptop makes no decisions. It makes billions of micro-decisions — each one this simple.

Plate XXV — The smallest decision AND · OR · XOR · NAND
Flip the switches and read the lamp — then try every gate.
A · ONB · offANDoffon only when both are ontap the switches · the lamp answers instantly
FIG. XXV — THE SMALLEST DECISION
Gate
truth table
0 · 0 → 0
0 · 1 → 0
1 · 0 → 0
1 · 1 → 1
A gate is the world's smallest decision-maker: it looks at its switches and answers on-or-off by one fixed rule. That's all a computer chip is — billions of these, wired so each lamp becomes the next gate's switch. Try XOR: it's the "do they disagree?" gate, and it's how computers add.
The short answer

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.

Try it at home Be a half-adder
  1. 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.
  2. 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.
  3. 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.