PREVIEW
relay-logic

OR Gate from Relays: The Logic of Either and Jevons' Victorian Logic Machine

DigiSim Relay Team DigiSim Relay Team
8 min read

In the previous post, we built the AND gate from relays: two contacts in series, both coils must fire for the lamp to light. Boole’s notation for that rule is ABA \cdot B — AND as multiplication. It’s the strict gate. It demands everything.

Now meet its counterpart.

Wire two relay contacts in parallel: two separate paths from the power rail to the lamp, each guarded by its own relay. Energize either coil and that contact closes, completing one of the two paths, and the lamp lights. Both coils? Lights. Just one? Still lights. Neither? Dark. Three out of four combinations succeed. This is the generous gate — the one that needs only something.

Boole’s notation for it is just as clean: if AND is multiplication (ABA \cdot B), OR is addition (A+BA + B). The lamp is 1 whenever A+B1A + B \geq 1, dark only when both terms are 0. Once you know the physical rule, the symbol writes itself.

From parallel switches to parallel relay contacts

If you worked through Post 3 in this series, parallel wiring already feels familiar. Two knife switches side by side, each offering its own path to the lamp — close either one and the current finds a route. You discovered the OR truth table then, from copper and spring steel alone.

What’s different in this post is the nature of the inputs.

In Post 3, the switches were opened and closed by a hand. The inputs were physical actions. In the OR gate, we replace those knife switches with relay contacts: the contacts are moved not by a finger, but by coil currents — electrical signals arriving from somewhere else in the circuit. Coil A’s signal controls where contact A sits. Coil B’s signal controls contact B.

That substitution looks modest. It changes everything.

An electrical signal can arrive from anywhere — including from the output of another gate. The AND gate from Post 4 produces an output signal; wire it into the coil of an OR gate and the AND gate is now feeding the OR gate. The OR gate’s output signal can feed the next gate downstream. This is the leap from switching circuits to logic circuits: outputs are inputs, gates respond to each other, and the chain can be extended indefinitely — which means a sufficiently large network can compute anything.

The Logic Piano: when OR got a keyboard

Here is the part of this story that should stop you for a moment, because it stretches back much further than relay engineering or telephone exchanges.

William Stanley Jevons was a Victorian English economist and logician, best remembered for developing the theory of marginal utility. But in the late 1860s, working at his desk, he was also building something stranger: a machine that computed Boolean logic by purely mechanical means. He called it the Logical Piano.

Completed around 1869, the device had a small keyboard of lettered keys representing four Boolean variables — A, B, C, D — and their negations. Across the top, a panel of rods displayed all sixteen possible true/false combinations. Press in a logical premise — “A and not-B” or “B or C” — and the machine would physically retract every rod corresponding to a combination that violated it, leaving only the consistent ones standing. It could evaluate any combination of AND, OR, and NOT over four variables, displaying every valid implication of a set of stated conditions. It was demonstrated publicly in London, written up in scientific journals, and is preserved today in the Oxford Museum of the History of Science.

What makes the Logic Piano so striking is its position on the timeline. Boole published his algebra of true and false in 1854. Jevons completed this machine in 1869. Claude Shannon’s landmark relay-circuit thesis arrived in 1937. The Logic Piano sits exactly in the middle — a device that physically implemented AND, OR, and NOT at a time when no one yet knew how to wire those operations into an electronic circuit.

It is the missing link: proof that the dream of building logic into hardware is old, and that OR has always been part of the toolkit. When Shannon showed in 1937 that relay networks could carry out Boole’s algebra, he wasn’t inventing a connection that had never been imagined. He was giving an electrical body to an ambition a Victorian logician had already pursued with levers and keyboard keys — and one post ahead of us in this series, we’ll meet him properly.

The OR gate truth table — in physical clothing

Back to our relay circuit. Two relays, coil inputs A and B, contacts wired in parallel, lamp at the output.

ABOut (A+BA + B)
000
011
101
111

Three lit rows, one dark. The single dark row — both coils off — is the only configuration where both contacts are open simultaneously, leaving no path for current. Any energized coil closes its contact, and any closed contact completes at least one path to the lamp.

Compare this to the AND truth table from Post 4: one lit row, three dark rows. AND is the inverse personality — strict, demanding, dark by default. OR is generous, bright by default, extinguished only by total absence.

The middle two rows are mirrors: A off with B on, A on with B off — identical output in both cases. OR doesn’t care which input provided the 1, only that at least one did. Lose one signal entirely, and the other carries the answer alone.

In Boole’s notation, A+B=1A + B = 1 whenever A=1A = 1 or B=1B = 1, with the only special case being 1+1=11 + 1 = 1 — two true inputs still produce one true output, not two. In Boolean arithmetic, truth doesn’t double; it simply is.

Try it yourself — OR in relay form

Below is a live OR gate: two relays with their contacts wired in parallel, Coil A and Coil B as independent inputs, a lamp at the shared output. This is a genuine electromechanical simulation running in your browser — not an animation, but an actual DC circuit obeying the same physics as the real thing. Turn your sound on.

Before you touch anything, run through the truth table and make a prediction. Which rows light the lamp? Then check each one.

Two relay contacts in parallel form an OR gate. Energize either coil — or both — and the lamp lights. Open it in the DigiSim Relay Lab.

Three experiments worth running before you move on:

  1. Energize one coil at a time, A then B. The lamp lights both times, and the sound is identical: one click in, one lamp on. The OR gate is perfectly indifferent to which coil you chose. In Jevons’ Logic Piano, pressing key A or pressing key B both left the “A or B” row standing. The generosity is the same whether the mechanism is levers or relay contacts.

  2. Compare directly with the AND gate from Post 4. In the AND gate, energizing only one coil left the lamp dark — the uncooperating contact was a veto. In this OR gate, energizing only one coil is enough — the other contact can be doing whatever it likes and the lamp doesn’t care. AND requires unanimity. OR requires only one vote. These are not arbitrary circuit choices; they are the two fundamental ways a multi-input system can decide to fire.

  3. Energize both coils, then release one. The lamp stays lit — current reroutes through the surviving path without a flicker. Only releasing the second coil extinguishes it. One path down, no outage. That’s redundancy made audible, the same design principle that prompted telegraph engineers to run parallel lines across continents.

Why signals as inputs make all the difference

When Coil A fires and the OR gate’s lamp lights, the current flowing through the output is just another electrical signal — indistinguishable from the coil current that energized Coil A in the first place. Wire that output into the coil of a downstream AND gate, and the OR gate is now feeding logic to the AND gate. Wire that AND gate’s output into a NOT gate’s coil, and the NOT gate’s output into another OR gate, and you have a three-gate chain making a decision none of the individual gates could see on its own.

Gates that respond to signals can chain indefinitely. Gates that respond to hands cannot. That’s the entire reason relay logic made computing possible — and it’s why the OR gate isn’t just a curiosity but a fundamental building block. The billions of transistor gates inside a modern processor are doing exactly what these relays do: AND, OR, NOT, in chains millions of stages deep, the output of each gate feeding the inputs of the next, the whole structure computing something no single gate could comprehend alone.

What you just learned — and what’s next

Post 5 of Building a Computer from Relays adds these pieces:

  • The OR gate is two relay contacts wired in parallel: the lamp lights when either (or both) coil is energized.
  • In Boole’s notation: A+BA + B — OR uses the addition sign, with 1+1=11 + 1 = 1 as the only special case.
  • The truth table has three lit rows and one dark row — the mirror image of AND’s one lit, three dark.
  • William Stanley Jevons built a mechanical “Logic Piano” in 1869 that physically computed AND, OR, and NOT over four variables — the missing link between Boole’s 1854 algebra and Shannon’s 1937 relay circuits.
  • The key leap from switch circuits to gate circuits is that inputs are signals: electrically controlled, chainable, capable of driving the next gate’s coil.

In Post 6, we complete the trio with the NOT gate — the inverter, the one that turns 1 into 0 and 0 into 1. And we meet the man who finally tied the whole picture together: Claude Shannon, whose 1937 MIT master’s thesis proved that any logical function can be built from AND, OR, and NOT. We’re one gate away from having the complete vocabulary of computing.

Want to chain the OR gate into something larger right now? Every circuit in this series is wired and waiting in the DigiSim Relay Lab — drag relays onto a canvas, connect their outputs to other coils, and hear the logic clicking into place.