relay-logic

AND Gate from Relays: George Boole's Algebra, Wired in Copper

DigiSim Relay Team DigiSim Relay Team
8 min read

In the previous post, you wired two switches in parallel and felt OR emerge from the circuit itself — a lamp that lights when either switch closes. In Post 2, you wired those same two switches in series and discovered AND: both must close before the lamp sees a single electron.

Two arrangements, two rules, felt with your hands. But here’s the trouble hiding in that phrase — felt with your hands.

If a human has to throw each input switch, no machine is doing any reasoning. The circuit is just an elaborate way to operate a lamp. A “logic device” that needs a person to set every input isn’t computing anything — it’s taking dictation. For logic to become a machine, the inputs need to be electrical signals, not fingers. And for a chain of operations to run automatically, those signals need to come from the outputs of previous gates.

Post 4 is about one change that makes that possible: we stop using hands and start using relay coils as inputs. That swap — knife switch out, coil in — is what lets logic run without a human in the loop. And a nineteenth-century mathematician named George Boole gave it a name.

From knife switches to relay coils

Go back to Post 1 for a moment. A relay has two completely separate circuits: the coil side, where an input signal energizes an electromagnet, and the contact side, where that magnet moves a physical switch. One circuit controls the other without any direct connection between them.

In Posts 2 and 3, the “inputs” were knife switches you pushed with your finger. But a knife switch and a relay contact do exactly the same job: they either pass current or they don’t. Replace the knife switches with relay contacts, and the relay coils become the new inputs.

Here’s the relay AND gate:

  • Two relays — call them Relay A and Relay B — sit side by side.
  • Each relay’s coil connects to an independent input signal: any voltage, from any source.
  • The normally-open contacts of both relays are wired in series with the lamp, exactly as in Post 2’s series circuit.

Relay A’s coil energized → its contact closes. Relay B’s coil energized → its contact closes. The lamp lights only when both contacts close simultaneously — the series path still demands both. The logic is identical to what you felt with your hands in Post 2:

ABOut (A · B)
000
010
100
111

Same four rows. Same single lit row. But the nature of A and B has changed completely. They are no longer fingers on levers. They are voltages. Electrical signals. Things that any circuit can produce.

And the output — the current flowing through the lamp circuit — is itself an electrical signal. A voltage that can, in turn, energize the coil of another relay.

The moment computing becomes possible

Wire the output of one AND gate directly to the coil of a second AND gate — no human involved. The second gate evaluates its condition from the first gate’s result and some other signal. No hand required.

Chain ten gates and the cascade evaluates a ten-variable logical expression in the time electricity takes to travel the wire — while no human touches anything. Chain hundreds, as the Bell Labs engineers building the first relay computers did, and the cascade performs arithmetic and makes decisions on its own.

This is the moment relays stop being interesting switches and become logic. The click is no longer a human gesture. It is a computation.

George Boole and the algebra nobody expected to need

Now for the mathematician who got there first — and who had no idea anyone would ever wire his ideas in copper.

George Boole was born in Lincoln, England, in 1815, the son of a shoemaker. His family had no money for a real education, so he taught himself mathematics from library books and was running his own school by sixteen. By thirty he was corresponding with leading British mathematicians without having attended university. In 1849 he became the first professor of mathematics at Queen’s College in Cork, Ireland — an outsider holding a chair because no trained man could match his work.

In 1854, Boole published An Investigation of the Laws of Thought. His goal was audacious: to reduce all logical reasoning to algebra. Truth and falsehood would be 1 and 0. The operation “A and B are both true” would be written ABA \cdot B — multiplication, exactly as in ordinary algebra. “A or B is true” would be A+BA + B. “Not A” would be 1A1 - A. The system would obey clean algebraic rules, and those rules would capture everything a logical argument could do.

Boole’s algebra has one defining property that ordinary arithmetic lacks: it lives entirely in two values, 0 and 1. Everything stays there. And those two values map perfectly onto on and off, true and false, current flowing and no current.

Now look at the AND gate’s truth table above. ABA \cdot B equals 1 only when both A=1A = 1 and B=1B = 1. In every other case — 000 \cdot 0, 010 \cdot 1, 101 \cdot 0 — the product is 0. That is the exact four-row table you just saw. Two relay contacts in series, controlled by two coils, evaluating an expression a Cork professor wrote to describe the structure of human reason.

Boole died in 1864 at forty-nine — he reportedly walked to a lecture in the rain, refused to cancel class, and never recovered from the resulting illness. He never saw a relay computer. He was doing pure mathematics, trying to understand how thought itself worked, not how to build a machine.

The connection to physical circuits wouldn’t be made explicit for another seventy-three years, by an MIT graduate student named Claude Shannon whose 1937 master’s thesis proved that any Boolean expression can be wired as a relay circuit, and any relay circuit computes a Boolean expression. That story arrives in Post 6. For now: the circuit you’re about to toggle is not an engineering invention that a mathematician later described. It’s a mathematical truth that engineers later built.

Try it yourself — coils, not fingers

Below is a live relay AND gate: two relays, each with its own coil toggle, their normally-open contacts wired in series, and a lamp that waits for both coils to be energized at once. This is a real DC circuit simulation running inside the page — not an animation. The armatures move, the contacts switch, the current flows or it doesn’t.

Before you flip anything, make a prediction using Boole’s notation: which combinations of AA and BB satisfy AB=1A \cdot B = 1?

Two relays, contacts in series. Both coils must energize before the lamp lights — that's the AND gate built from relays. Open it in the DigiSim Relay Lab.

Three things to notice while you play:

  1. Energize one coil at a time. Toggle A alone, then B alone. Each time you hear the relay click: the armature moves, the contact closes, work is done — but the lamp stays dark. The series path is still broken at the other relay. Half the condition met is not enough. AND requires both, and the circuit enforces that without needing to be told.

  2. Compare the sound to Post 2. In the series switch circuit, flipping a switch was one event. Here every input change is two: the coil energizes, then the contact moves. You hear the gate make its decision — that mechanical delay is the armature traveling, a tiny window in which the relay is, in some sense, thinking.

  3. Imagine what A and B could be. They’re attached to toggle switches here for convenience, but they could wire to anything that produces a voltage: another AND gate’s output, a temperature sensor crossing a threshold, a clock signal ticking ten times a second. The logic doesn’t change. AB=1A \cdot B = 1 only when both are 1. The circuit doesn’t know or care what drove its inputs.

When gates chain, something new appears

The lamp in this AND gate is not decorative — it represents a voltage level: lamp on means the output is high (logic 1), lamp off means it’s low (logic 0). That output can connect directly to the coil of a downstream relay, making the first gate’s result an input to a second gate. You never touch the second coil with your hand.

With AND, OR, and NOT (the normally-closed contact from Post 1) all available as electrical-input building blocks, you can now design arbitrary logic circuits on paper using Boole’s notation and then wire them exactly as written. AB+CA \cdot B + C — AND two signals, then OR the result with a third — is two gates and three wires. The algebra and the circuit are the same sentence in two languages.

Boole’s language and the hardware are interchangeable — relay, transistor, CMOS gate, all implementation details for the same two-valued arithmetic. The language existed first, written by a professor trying to formalize thought, and the hardware turned out to be its natural body.

What you just learned — and what’s next

This post added three things to your toolkit from Posts 1–3:

  • Replacing knife-switch inputs with relay coils means inputs are electrical signals — and signals can come from other gates.
  • Two relay contacts in series is the AND gate: same truth table as Post 2, but now the inputs and outputs can chain automatically, without human hands.
  • George Boole wrote the algebra of AND, OR, and NOT in 1854 while formalizing logic — decades before anyone wired it in copper. His ABA \cdot B is the exact four-row table you just toggled.
  • Claude Shannon made the bridge between Boole’s algebra and physical circuits explicit in 1937 — that story comes in Post 6.

In Post 5, we build the OR gate from relays: two relay contacts wired in parallel, so either coil energizing lights the lamp. It’s the electrical-input counterpart to everything in this post, and it completes the two-gate foundation we’ll need to start building arithmetic.

Every circuit in this series — this AND gate, the switch patterns from Posts 2 and 3, and all the gates still to come — is open in the DigiSim Relay Lab. Wire them together, connect one gate’s output to the next gate’s coil, and let the cascade click without you.