;colony/science  / Computers, Visually  / How do tiny switches add up to a computer?
Computers, Visually

How do tiny switches add up to a computer?

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

Plate 25 — The smallest decision AND · OR · XOR · NAND
Flip the switches and read the lamp — then try every gate.
Predict firstBefore you wire the gates: which inputs make an AND gate light up?
A · ONB · offANDoffon only when both are ontap the switches · the lamp answers instantly
PLATE 25 · 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.
Try with the plate
  • Build a half-adder from an XOR and an AND gate.
  • Make a gate that outputs true only when both switches are on.

A logic gate is a tiny circuit that takes one or two inputs and outputs a single answer by one fixed rule: AND outputs true only if both inputs are true, OR if either is. Chain millions of these together, each one feeding the next, and you get a computer.

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.

The common mix-up

Most people think a computer makes intelligent decisions. In fact it only makes billions of trivial ones (AND, OR, NOT) and nothing smarter is ever added; a whole CPU is just more of them, better arranged.

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.

Remember this

Chain enough dead-simple yes/no gates together and you get a computer — the Apollo guidance computer flew to the Moon on essentially one repeated gate.

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.

Common questions

How do simple gates do arithmetic?

Combining gates compounds their rules. An XOR gate gives the sum digit of two bits and an AND gives the carry; together they form a half-adder, the first cell of real addition. Chain eight and you can add whole bytes.

Can a computer be built from just one kind of gate?

Yes. NAND is functionally complete — every other gate can be made from NANDs alone, so a modern chip is essentially one idea repeated billions of times. The Apollo computer used almost entirely a single NOR-gate design.

Where is Boolean logic from?

George Boole worked out an algebra of true and false in 1854, as pure philosophy. Ninety years later it became the blueprint for electronics, with "true" as a high voltage and "false" as a low one.

Built & checked by Nilesh Singh · how this is made · last updated June 2026