class 19 · hour nineteen of fifty · arc three opens
How do you add one column?
You have spent twelve hours on what bits mean and six on what gates do. Those two halves have never once touched. Today they do.
Take the send off before anything else. Some of them will already have the table you are about to derive.
Everything you know, and the gap down the middle of it.
the thing nobody has said out loud yet
Back in Class 5 you picked two's complement, and the reason you gave was that a machine which only counts forwards would get subtraction right for free.
That was a promise about a circuit. The circuit did not exist. It still does not.
Adding depends only on the bits in front of it, so Class 15 guarantees it can be built. Today you find out what it costs.
This is the arc opening. Eighteen hours of groundwork, and the payment starts now.
start as small as the problem goes
Add one bit to one bit. Three of the four answers are easy.
Click through the four cases. Nothing interesting happens until the last one.
One and one is two, and two does not fit in a bit. The answer needs a second digit, and there is nowhere on this diagram to put it.
so give it somewhere to go
The bit that fits is the sum.
The bit that does not is the carry, and it belongs to the next column along.
Adding produces more digits than it consumes. That single fact is why this arc runs eight hours.
Let them click all four before you name anything. The names land better once the problem is felt.
four rows, two answers per row · press build
Two outputs means two functions, so hand each one to Class 15 separately.
The sum column is 1 when exactly one input is. They have met that shape three times and it is still XOR.
SO FAR SO CHEAP
click either input
Two gates, and the carry lights on one row out of four.
and it has a name, which should worry you slightly
This is called a half adder. Two gates, depth one, and it is genuinely correct for adding two bits.
Nobody names a thing half unless something is missing. Finding out what takes about thirty seconds.
Ask why it is only half, then go straight to the next slide rather than answering.
click any bit to change the numbers · then work the columns
Do an addition the way you were taught, and watch where it goes wrong.
Stop after one press. The second column already has three numbers in it, and the half adder has two inputs.
THAT IS WHAT WAS MISSING
Only the rightmost column ever gets two inputs.
remember
Every other column also takes a carry from its right. Three inputs, not two, on thirty one columns out of thirty two.
So the half adder is usable in exactly one position, which is why it only ever got half a name.
What you actually need takes a, b and a carry in, and gives back a sum and a carry out. Three in, two out.
Three inputs is eight rows. You have known how to handle eight rows since Class 15.
Three in, two out. Put it on the board. Everything for the next two arcs is built from this one block.
click a row to work it out · there is no trick to this
Add the three bits like ordinary numbers, then write the total in binary.
Three bits can total 0, 1, 2 or 3. Every one of those needs two binary digits to write down.
Those two digits are your two outputs. The low one is the sum, the high one is the carry.
worth noticing
This is arithmetic you have done since you were six. The table is not the difficult part of the hour.
Four of the eight rows carry, and four do not.
Do two or three rows with the room out loud, then press fill. It settles quickly.
two output columns, two functions, two maps · click any cell
Give both columns to Class 17 and see what comes back.
Say nothing for ten seconds. Somebody will notice the left map has no circles drawn on it at all.
The sum map will not shrink. Not a little, not at all.
Its four cells never touch. Pick any two and they differ in two variables, or in three, but never in one.
So there is nothing to merge. Class 17's method runs, finds no pair to work with, and hands you back exactly what you gave it.
This is what XOR looks like on a map, and it explains why XOR has been awkward every single time you have met it.
three tools, three refusals
Class 13. It would not come out of switches in series or parallel. It needed a different kind of switch entirely.
Class 14. No single pull up and pull down pair produces it, so it cost four whole gates.
Class 19. Its map is a checkerboard, so there is nothing for minimisation to hold on to.
One reason underneath all three: XOR asks whether two things differ, and difference does not factor.
Seven sessions apart. They will not have joined these up, so join them explicitly.
NOW THE OTHER MAP
press compare
You built the carry circuit three sessions ago, for something else entirely.
This is a promise from Class 16 being kept. Let them enjoy it rather than hurrying past.
press add to place one piece at a time · then click any input to test it
Put the two halves together.
Build it piece by piece the first time. Once it is whole, hand over the inputs and check a few rows.
ONE COLUMN, FINISHED
Six gates, and the carry is out after two of them.
remember
Two gate delays is about forty picoseconds. For one column, of one addition.
Hold on to that number. Next session there are thirty two columns, and the carry has to get across all of them.
The sum and the carry arrive together, but it is the carry that the next column is waiting for.
Forty picoseconds sounds like nothing at all. Multiply it by thirty two on the board and let them do it.
One column of an addition, and it took six gates.
what you are carrying into next session
A block with three inputs and two outputs, made of an XOR that refuses to shrink and a majority vote you built for a boiler.
Thirty two of them will make an adder, and the wire between each pair is the carry.
That wire is going to turn out to be the most expensive thing in the machine, and it will take three more sessions to deal with it.
Show the strip. This is the arc's spine and it comes back at the start and end of every hour.
Three inputs, two outputs, and nothing in it is new.
An XOR you have fought with since Class 13, and a majority vote you built to shut down a boiler. Adding turned out to be two old circuits standing next to each other.
Next session: thirty two of these in a row, and what the carry does on its way across.
Stop here. Send off: add 255 and 1 in eight bits, by hand, column by column. Write down what the last carry does and where it goes.