class 13 · hour thirteen of fifty · arc two opens
Can a switch
do arithmetic?
Twelve hours writing numbers down, and not one of them can be added to another. Today we start again, from a light switch.
Collect the send off first. Somebody should have found the overflow flag in a status register.
You can store 5.
What adds 1 to it?
Not what represents 6. You have known that since Class 4.
What physical thing takes the pattern 101 and produces the pattern 110?
Let the room try. They will reach for software, and there is no software here yet.
flip them. the orange line is the current. fill in all four rows.
Start with two switches on one wire.
Name nothing. Ask the room for combinations until all four rows fill in.
now give the current a second route
The same two switches, wired side by side.
Same two switches, same lamp, different table. Only the copper changed.
and a third place to put a switch
Beside the lamp, not in front of it.
remember
- Both ends of this switch join the same two points as the lamp, so it offers the current a second route.
- Closed, that route has no lamp in it and almost no resistance, so the current all goes that way and the lamp is dark.
- Open, there is no second route, so the current must pass through the lamp and it lights.
- Switch on, lamp off. One switch, and the output is the opposite of the input.
The phrase short circuit comes from exactly this. The current is taking a shorter path than the one you intended.
Three ways to lay copper. Three tables.
IN A ROW
both, or nothing
One path through both switches. Open either and the lamp goes out.
SIDE BY SIDE
either will do
Two paths. Close either switch and the current gets through.
ACROSS THE LAMP
the opposite
A shorter route past the lamp. Close it and the lamp goes dark.
remember
- Nothing so far is mathematics. All three are descriptions of where the copper goes.
- Each table was found by trying every combination, and there were only ever four of them.
- Everything in the next thirty seven hours is built from these three arrangements.
Say the last line plainly and let it sound absurd. It is true.
now something you already own
A light with a switch at the bottom of the stairs, and another at the top.
Ask how it is wired before saying anything. Every house has one and nobody has ever wondered.
Try it with the three arrangements you have.
In a row. The light is on only when both switches are on, so the person at the top can turn it off but never on.
Side by side. The light is on when either is on, so the person at the top can turn it on but never off.
Any mixture. Still fails, and you can spend a while proving that to yourself.
what is actually required
- Either switch, on its own, must change the answer, whatever position the other one is in.
- An ordinary switch either completes a path or breaks it. It has one job.
- So the fix is not a cleverer arrangement. It is a different kind of switch.
Let them attempt it. Two minutes of failing here makes the next slide land properly.
one that moves a connection instead of breaking it
Two changeover switches, and two wires between them.
remember
- The lamp lights when both switches point at the same wire. Flip either one and it changes, every time.
- That is called XNOR. Relabel one switch's two positions and it becomes XOR. Identical copper, different names.
- It needed a better switch and twice the wire. Remember that when the adder arrives in Class 19.
Flip a, then b, then a again. The lamp changes on every single press, which is the property they were asked for.
lincoln, england, 1847
Ninety years before any
of this was wired up.
George Boole, largely self taught, running a school. He asks what happens if the letters in an algebra stand for statements rather than quantities.
His variables take two values. His operations are and, or and not. He proves the laws you would expect, and several you would not.
remember
- He had no machine in mind. There were no machines to have in mind.
- He was formalising human reasoning and thought of it as philosophy.
- It sat in logic departments for ninety years, admired and unused.
1847 is eleven years before Babbage died, and they never connected. Both halves of this course existed at once and did not meet.
mit, 1937 · claude shannon, aged twenty one
He put your three arrangements next to Boole's three operations.
|
lit only when both are closed |
a · b |
BOOLE CALLED THIS CONJUNCTION |
|
lit when either is closed |
a + b |
BOOLE CALLED THIS DISJUNCTION |
|
lit only when the switch is open |
ā |
BOOLE CALLED THIS NEGATION |
Every row matched. Not an analogy: the same structure, so every theorem Boole proved became a fact about copper.
His master's thesis, 1937, about twenty pages. Often called the most consequential master's thesis ever written.
and here is what that is worth
Boole proved a · (b + c) = a·b + a·c on paper in 1847.
remember
- Two arrangements of copper. Three switches on the left, four on the right, and identical behaviour on all eight combinations.
- You could check that by building both and trying every input, which takes a while.
- Or you can read it off a line of algebra somebody wrote before electricity was practical.
- The left circuit is cheaper. Algebra is how you find the cheaper one without building either.
Doing this properly is Class 17. Today only show that the possibility exists.
click the output cells. find all sixteen.
How many different things can two switches decide?
AND
FUNCTION 1 OF 16
A function of two switches is just a decision about what the lamp does in each of four situations.
Four decisions, two answers each.
2 × 2 × 2 × 2 = 16
Not roughly. Exactly, and nobody can invent a seventeenth.
AND is 1, OR is 7, XNOR is 9. Every circuit built this hour is somewhere in the sixteen. Make them find them.
So what happens when C runs a & b on two whole bytes?
remember
- Not a loop over eight bits. Eight separate copies of the two switch circuit, all settling at the same instant.
- Bit 3 has no wire to bit 4. Each column decides on its own and cannot be told anything.
- That is why the hardware is cheap: design one column, print it eight times.
- It is also exactly why this cannot add. A carry has to travel sideways, and there is nothing for it to travel along.
Point at the red arrow. That missing wire is the whole of Class 19.
And there is one more thing badly wrong with all of it.
Every switch today was flipped by a hand. Every circuit needed a person to set the inputs.
To add 5 and 1, the output of one stage has to become the input of the next, with nobody in between.
A lamp cannot flip a switch.
So we need a switch operated by electricity rather than by a finger.
This is the gap relays filled, and relays are what Shannon was actually working with.
Three arrangements of copper,
and an algebra written for philosophy.
Nobody put them together for ninety years, and when somebody did, circuit design stopped being a craft.
Next session: what a switch is made of, once you stop using a finger.
Stop here. Send off: find a decision in your day that is a truth table, write out every row, and bring it. Not a program. A decision.