Majority gate

Three inputs, one lamp — it lights when at least two of them agree. A ready-made fun circuit you can open in the TorchAnvil simulator.

A vote, in gates

Give three people a vote each. The motion passes when at least two of them say yes. That's a majority gate: three inputs in, one output out, true whenever two or more inputs are true. It's one of the oldest "useful" logic functions — simple enough to build from AND and OR, and surprisingly practical.

How it works

The function is M = (A·B) + (A·C) + (B·C). In words: check every pair. If any pair is both-on, declare a majority. That comes out to three ANDs (one per pair) fed into an OR tree:

Each lever fans out to two AND gates (A goes to A·B and A·C; B goes to A·B and B·C; C to A·C and B·C). That's fine — a single source can drive as many targets as you like. The rule is only that each target pin gets exactly one edge.

A B C M
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

Why it matters

Majority logic is the heart of triple modular redundancy — a fault-tolerance trick where you run three copies of a sensor or computation in parallel, then trust the answer that at least two of them produce. It's how spacecraft survive stray cosmic rays flipping bits; the Space Shuttle used it, and so do modern rovers, satellites, and safety-critical controllers in cars and medical equipment. One bit can lie; two rarely do at the same time.

Try this