PREVIEW
relay-logic

NOT Gate from a Relay: Claude Shannon's Thesis and the Logic That Completes Computing

DigiSim Relay Team DigiSim Relay Team
8 min read

In the previous post in this series, we wired a relay’s normally-open contacts in parallel and watched OR appear from the circuit without any abstraction required. Step back and look at what we now have: AND from contacts in series, OR from contacts in parallel. Two of the three foundational operations of all digital logic.

Here is the problem. Two operations, no matter how cleverly you combine them, cannot say no.

Wire AND and OR together in any arrangement you like and you will find you cannot build a circuit that lights a lamp because its input is dark. You cannot say “when switch A is off, turn the lamp on.” There are entire categories of thought — every conditional of the form if NOT this, then that — that AND and OR together simply cannot express.

That missing piece lives in a contact you have already met.

The normally-closed contact — the gate hiding in plain sight

In Post 1 of this series, we learned that a relay has two contact personalities. There is the normally-open (NO) contact — the one we used in AND and OR. At rest it is open; energize the coil and it closes. The coil’s signal is passed along to the output circuit.

Then there is the normally-closed (NC) contact. It is the mirror image. At rest — coil off — the contact is closed, and current flows freely through the output circuit. Energize the coil and the armature physically pulls away from the NC contact, opening it. Current stops. The lamp goes dark.

Read those two states carefully:

  • Coil off → lamp on.
  • Coil on → lamp off.

The input does the opposite of what the output does. The relay does not transmit its input signal; it inverts it. When A is 0, the output is 1. When A is 1, the output is 0.

That is NOT.

There is nothing to add to the circuit. No extra component, no clever wiring trick. The NC contact is the NOT gate, built into every relay that has ever existed. It was there from Post 1 — we just needed AND and OR behind us to appreciate exactly why its existence matters so much.

The truth table: two rows, one revolution

The NOT gate has only one input and one output, which makes its truth table the smallest in all of digital logic. But these two rows carry as much conceptual weight as any circuit truth table in existence:

AOut (¬A)
01
10

There is something philosophically striking about this table. Every gate we have met before — AND, OR — combines two inputs into one output. They ask: what do A and B together decide? NOT asks a different kind of question entirely: what is A’s complement — its other half? It is not a combination; it is a reflection.

The symbol ¬A (also written Aˉ\bar{A}, or NOT A) expresses a precise relationship: wherever A is present, ¬A is absent, and vice versa. In a world of only 0s and 1s, A and ¬A always disagree — the two halves of a coin that never show the same face.

Claude Shannon and the thesis that unified everything

It is 1936. A 20-year-old named Claude Shannon arrives at MIT to pursue a master’s degree in electrical engineering. His advisor, Vannevar Bush, has built the Differential Analyzer — a room-sized analog computer assembled from gears, shafts, and motor-driven integrators — and puts Shannon to work maintaining it and translating its mechanical configurations into formal mathematical expressions. Shannon is learning, in the most hands-on way imaginable, how physical systems encode mathematics.

While doing so, he reads something that stops him cold.

Nearly a century earlier, an English mathematician named George Boole had published a peculiar algebra of true and false. In Boole’s system, every variable takes one of only two values. Multiplication corresponds to logical and — the product ABA \cdot B equals 1 only when both A and B are 1. Addition corresponds to logical or — the sum A+BA + B equals 1 when either or both are 1. Complementation — written Aˉ\bar{A} — gives the opposite of A. For decades, Boole’s algebra had been treated as a curiosity in symbolic logic, an intellectual exercise with no practical application beyond the philosophy of reasoning.

Shannon sees the bridge.

The algebra that Boole invented to describe abstract propositions of thought maps, perfectly and completely, onto the behavior of relay switching circuits. Series connection is Boolean AND (ABA \cdot B): current flows when A and B are both closed. Parallel connection is Boolean OR (A+BA + B): current flows when A or B — or both — are closed. The normally-closed contact is Boolean NOT (Aˉ\bar{A}): the output is active when A is inactive.

This is not an approximation or a metaphor. It is an exact, formal equivalence.

In 1937, at the age of 21, Shannon submits his master’s thesis: A Symbolic Analysis of Relay and Switching Circuits. In it, he proves what he saw intuitively: any network of relay contacts can be translated directly into a Boolean algebraic expression, and any Boolean expression can be implemented as a network of relay contacts. The two languages — copper and algebra — describe the same objects. You can move freely and rigorously between them.

The implications are enormous. Before Shannon, relay circuit design was craft: intuition, experience, trial and error. After Shannon, it is algebra. You write down the logical function you want, simplify it using Boole’s rules, and build exactly the simplified form in wire and contacts. No guessing, no hidden redundancy, no missed simplifications.

The thesis has been called the most important master’s thesis of the 20th century — and the case is hard to argue with. Every Boolean simplification you carry out in a circuits course, every gate symbol on a schematic, every chip in every device traces a direct intellectual lineage to those pages.

Charles Petzold tells this same story, beautifully, in CODE: The Hidden Language of Computer Hardware and Software — a book that treats relay circuits precisely as we are treating them in this series: as physical, audible, toggle-able logic. If these posts have made you hungry for more depth, CODE is where to go next.

Try it yourself — predict the reversal

Below is a live simulation of a single relay wired to its normally-closed contact. Before you interact with anything, make a prediction: at rest, with no input signal, is the lamp on or off? Now activate the coil — what happens? Unlike every circuit in the earlier posts, sending a signal here extinguishes the lamp rather than lighting it. That reversal is NOT in action.

A single relay, normally-closed contact: the lamp is ON at rest and goes OFF when you energize the coil. One relay, zero extra components — that's NOT. Open it in the DigiSim Relay Lab.

Three things to pay attention to as you explore:

  1. The lamp starts on. Before you do anything, the lamp is already lit. This resting state — current flowing through the closed NC contact without any input — is NOT’s defining signature. The circuit is on by default and the input’s job is to turn it off. That flipped sense of causality is the whole point.

  2. Energize and listen. When you close the coil circuit you hear the same relay click as in every previous post — but the outcome is now reversed. The click that lit a lamp in the AND and OR gates turns one off here. Same physical mechanism, mirrored meaning.

  3. Compare to Post 1. The single-relay simulation from Post 1 lets you toggle the NO contact. Run both side by side and give them the same input: one lamp brightens while the other dims. Same physical event, opposite outcomes — Shannon’s complementation made visible and audible.

Completeness: the key that unlocks the whole space

With only AND and OR, you can compute a useful but fundamentally limited range of functions. There are Boolean functions that AND and OR together cannot express regardless of how many stages you chain — precisely the ones that require saying no somewhere, expressing conditions under which an absence produces a presence.

Add NOT and everything changes.

AND, OR, and NOT together are functionally complete. That is a specific claim in logic theory: any Boolean function whatsoever — any truth table with any number of inputs and any combination of 0s and 1s in the output column — can be expressed using only these three operations. Equip yourself with AND, OR, and NOT, and you can compute anything that is computable from logical conditions.

Shannon’s thesis proved this directly. The Boolean algebra he mapped onto relay circuits is complete: every expressible logical relationship has a corresponding switching circuit, and every switching circuit has a corresponding logical expression. That completeness is why Shannon’s result did not merely improve relay circuit design — it laid the theoretical foundations for all of digital computing. Every processor, every memory cell, every arithmetic unit descends from the claim that logic can be wired and wiring can be reasoned about as logic.

Notice that this completeness hinges on the smallest gate: one input, one output, nothing but a flip. NOT is what makes negation possible, negation is what makes conditionals possible, and conditionals are what make decisions possible. Decision-making is what computing is.

We have AND. We have OR. We have NOT. We have everything.

What you just learned — and what comes next

In this post, the series reached its first major summit:

  • The normally-closed contact is NOT, built into every relay from the beginning — the gate that was always there, waiting to be recognized.
  • A relay wired to its NC contact is a complete inverter: input 0 → output 1, input 1 → output 0.
  • Claude Shannon’s 1937 thesis proved that relay contacts are Boolean algebra in physical form — series is AND (\cdot), parallel is OR (++), NC contact is NOT (Aˉ\bar{\phantom{A}}).
  • AND + OR + NOT is functionally complete: with these three operations you can express the entire space of Boolean logic — every truth table that can be written down.

From here, the series can build anything — NAND, NOR, XOR, adders, latches, registers, a complete computer. All of it is combination and application of what you now hold.

But before we rush to complexity, there is one more single-relay gate to meet. In Post 7, we will wire a relay to its normally-open contact all by itself — a gate that passes its input through unchanged. It sounds trivial. In practice, it quietly makes every large relay machine possible. The humble Buffer is next.

Want to keep building? Every circuit in this series lives in the DigiSim Relay Lab.