Well I've just balanced a whole lot of
dominoes up and what I wanted to do is
look at how computers actually do maths for us.
How on earth can a mechanical system
like just a chip in a computer - how can it
actually do arithmetic. This is my input
Domino here. If I bump the input Domino
it's going to send a signal down the
chain and normally you just have a one
single chain of dominoes
so I've mixed it up by... well initially
splitting the chain which in itself is
not that controversial but then the
shorter arm over here
knocks out some of these dominoes so if
these dominoes come toppling over
it'll bump these two out and this won't
be able to cross. So in fact this is a
circuit that stops itself. If I bump this
and it starts going
this will get their first, knock them out
this will come to a halt. These are my
output dominoes, this is the kind of the
output from the circuit that will not
fall over. If I now have two inputs so if
I only knocked over this second input
all it would do is these dominoes will all
fall over it would bump these out and
then it would stop - nothing would
happen.
So it means individually either one of
these bumped by itself that Domino will
not fall over. If I don't bump either of
these, that Domino will not fall over
so if I knock both of them together this
shorter one here will come along and knock
these out this one at the same time will be coming along it will split but when this
one gets here
these dominoes are already gone so it stops which means these dominoes don't move
this one will go all the way around it
comes along here comes down here
straight across and then out
So this circuit... the output only falls over
if and only if I bump both of these and
so we call this an AND circuit
it's got two inputs I have to knock over
one of them and the other one to get an output
I'll tell you what I do knocking none of them first, there you go that worked
now that the boring one is just this input because that will just knock that out and stop
The fun one is either just this
one so it stops itself or both of them
so the signal goes through what would
you... what yould you like?
I think on behalf of the viewers they're going to want to see both.
Yeah, are you ready (yeah) here we go one and the other
There you are so it worked! So we got an
output cause I did one and the other one
this is a working AND circuit. Now we can
describe this mathematically so we're
not quite adding numbers yet but it's a
good step in the right direction
So we'll call this one input one and I'm going to label that one there "input 1"
This one here can be input two so that's "input 2"
and then over here we have the output
so I'll label that "output" and what I'm
going to say is if a domino is standing
up then nothing's happened yet we'll call that a 0.
If it falls over we'll say it's
becoming a 1. So if you don't...
the first input doesn't fall over the second input doesn't fall over
the output in theory should not fall
over. If input 1 falls over but input 2 doesn't
the output won't fall over. If
input one doesn't fall over but input 2 does
the output still won't fall over
and then finally if both of these fall over together
the output falls over and we call that...
this is the logic table and so this is
what's called an AND... actually I'll lable it up here this is a AND GATE
So what I am going to try to build next is a
thing called an EXCLUSIVE OR
or XOR which is the... the best
name of the gate
you have input 1 we're going to have
input 2 we're going to have our output again
This time... again if I don't touch
any of the inputs
I don't want the output to fall over. Now
if I only bump input 1 but not 2
I still want the output to fall over this
input 1 has to go through the circuit
if I don't hit 1 but i do hit 2, I
still want the output to fall over and
then controversially if I bump both of
them together
I want them to somehow cancel out in the
circuit so nothing comes out
and that's why it's called an
EXCLUSIVE OR it's one input or the
other input but not both
that's the exclusive bit so I'm gonna
try and build an EXCLUSIVE OR circuit
out of dominoes give me... give me a second here
There we go so this is my EXCLUSIVE OR
gate and as you can see if you bump
over just input 1 it will come flying
in here it goes into the fork here it
will come along this way it will then go
out here we don't care if something
comes back up the circuit that's fine
more importantly it'll come around this way around there and then out and likewise
because it's symmetric, if I bump input 2
that goes along into the fork goes along
the middle comes around here and then
out the output. So either one by itself
will make it through the circuit. 
Importantly though if I bump them both simultaneously
they will be using the center at the
same time they will collide and stop and
the output won't fall over
I quite like the... doing both together,
right, cause that's the difficult bit
because anyone can make a circuit where
both inputs lead to the same output
I mean that's easy. One where that
happens and they can stop each other
that's where it gets fun. So I'm going to
give it a go. Unfortunately dominoes do
fall over quite quickly and you want to
have as much time as possible to enjoy the experience
So what we might do is put on some ridiculous lights and do the whole thing in slowmo
Okay right, okay that... that should be
adequate light... so we'll get this going
and in theory they will cancel out right
in the center. OK here we go: one and the other one
yes
OK so you see this guy is dangerously
close to going
so when this collided there's a bit of
recoil back up but thankfully again not
quite enough to bump these off going the
other direction. So there you are
It's the EXCLUSIVE OR together they didn't get through
So we've done the AND gate and made that work we've done the EXCLUSIVE OR gate that has worked
what we're going to do now is go
another step in the direction of ridiculous
we're going to have input 1 again
we're going to have input 2
We then... over here we have the output
now again these are standard options
that we have every time
they're all four ways you can bump over two inputs.
Now i'm going to have output 1 and
output 2. Output 1 is going to act as
if it was an AND gate so we'll have that
happening.
Output 2 is going to act as if it is an
EXCLUSIVE OR gate and what that means is
if you can have both of these outputs
for those two inputs
these are counting the number of inputs
they get bumped so this is like a units column
this is the ones column and that's
twos. So if you only bump one input over
the one output goes, if you bump both of them over you get the twos column goes
and so this is a very, very basic circuit
that can count. It can tell if you bump
just one or two
It doesn't matter which bump it can still
count it. So if i repurposed... because it
needs an exclusive or in the middle. If I
very carefully...
This is called a binary half adder
and the reason it's called a binary half
adder is it's doing half of what you
need to do full binary ari... oops...
full binary arithmetic
so if you can build what's called a
binary full adder
which believe me we'll get to in a second
then you can do all the calculations you
want. So a binary full adder is what
calculators use, what computers use it's the basis of all automated computation
All right so I'm almost finished. I'm
putting the last two dominoes in over here
It's a monster that
it really is... well you know well this... this is interesting because this chain splits
off and all it does is zigzag
backwards and forwards for a while and
the reason I had to go and do these
extra... cause I could have done just that, right
the reason I had to do these extra
dominoes is because this is a delay line
so I need to give... cause you can still see the EXCLUSIVE OR is in here
I need to give the EXCLUSIVE OR enough time to do its thing before this signal
catches up with it
so this is just delaying one of the
signals. The way this works is if I just
bump this input... Oh first of all, if I bump none of the inputs -
Perfect. If I just bump this input it
will come in here goes into the fork,
goes across the EXCLUSIVE OR, comes out the other side.
This waste signal just comes back and out that doesn't matter
it goes around here, goes around there and then it goes out the units output so that means that
one input was bumped if I bump this one now this is where it get's slightly more complicated
Here it splits and then one
signal goes through the EXCLUSIVE OR
all the way through, out the other side, comes around, comes here,
splits, goes out this... the units output. Also, it blocks these so this forks so
this one stops this chain
meanwhile the other signal's coming along here it gets to here and it's stopped.
So either one by itself only that output
falls over. If I bump them together
well this one splits again that one goes that way
this one's coming in, they collide in the
middle and stop, this one carries on its merry path,
gets right to the end goes
straight out that output and this one
falls over but that one doesn't
and so that's the twos output and so
that's the binary number that counts how
many of these dominoes I bumped. This... this is a circuit of inanimate objects that can count.
That excites you doesn't it? I.. I get disproportionately excited.
People say all right now I want to know how computers work and they mean you know I
want to know how to use microsoft word
or I want to know you know... or even
programming languages people go
"Oh I've learned to program!"
that will people go "You know
what, I do everything from the terminal prompt"
alright but... but you're still
just interacting with the software level
of the computer what's actually... how is the
computer actually executing what you're
telling it to do and right down at the very bottom this is the absolute fundamental
layer of all computing... is a circuit of
objects that can make decisions based on inputs.
Alright, so I'm gonna bump just this
one only that will fall over
that won't move. Here we go, ready?
The system works, look at that. So if they
were to stop this one from coming
through the EXCLUSIVE OR worked perfectly
this came through without being stopped
when out there's our units output this
one didn't move
if all you saw was this, you would know that back here
I only bumped one input not two
Alright so that worked. Now as I said, move that away, this is just the half adder
we want a binary full adder and to have
a full adder you need to have three
inputs so you have input 1, input 2 and
input 3, and so now we need every single
combination of... there is not bumping all of them, there's doing that, there is doing that,
there is bumping those,
there is bumping that one but not those, there's that one that one that one,
that one that one that one,
OK, there we are. That's all eight ways you can have three different inputs falling over and
now I'm going to label this. This is
going to be our twos column and this is
gonna be our ones/units columns. This is our binary counting of how many we bumped.
So there were bumped none of them,
there we bumped just one, just one, two of them,
one of them, two of them, two of them... and at the very end
three of them. And to have three we would expect that to happen.
So if we could build this circuit, we
would have the full binary adder and you
can build this right so all you need is
basically you chain together two half adders
which is why that's called the
half adder.
So a little bit of careful positioning... you need a lot of dominoes at this point
you need maybe two or three thousand dominoes to make this work reliably
you could make a massive circuit which does this and once you can do that
you can then add any binary numbers together that you want.
Shall we do a calculation? Shall we... I'll tell you what... if you want to give me two numbers
in you know... between 20 and 50 what shell we do? Let's do 42.
Yeah of course. And 17. OK so
right. So we're going to add 42 to 17.
A bit of a spoiler alert
we're expecting 59 just so we're all... I
mean don't... you know I don't want to ruin it for anyone
but OK so I'm going to turn
these into binary numbers. So 42 is going
to be a 32 which means I need another 10
so 32
no 16s, one 8, no 4s, a 2 and a 1
and then down here 17 is 0 1 0 0 0 1
so that's 42 and 17 in binary
And so now ah... and they're incredibly
boring numbers to add in binary
Why? Now because if I go along and
add them together
what's 0 plus 1? Is 1. 1 plus 0 is 1. 0 plus 0. 1 plus 0. 0 plus 1. and 1.
So at no point did you have... having to add two one's together.
Alright so that made the sum... what we just... you know that's what we get
for choosing random numbers. But we can double check the system works
because now that's... so I'll label that, well that's units 2s, 4s, 8s, 16s, 32s.
Our answers are 32 and the 16 which gives us 48, plus another 8 which gives us 56, plus a 2 which gives us
58 plus a 1 which gives us 59. So... that is 59 in binary, right so this is how it works.
What could have happened though... well let's just rig it with some
interesting binary numbers right. If I
had let's say 110111 and i'm adding it
to 011011, right. So I've
deliberately lined up loads of one's to
get in the way. Cause now if I do 1
plus 1
the answer's 2, and I can't write a 2
down there because it's binary what I
can do is I can write the 0 and carry
the 1,
And so now I've got to add three of
these together. So I've got to add OK,
1 plus 1 plus 1 is 3. So I write
the 1 carry the 1.
OK, 1 plus 1 is 2. Put them down there and every single time the only... oops, that should be a 0...
the only option I can have
is either... oh, I'm only ever adding
combinations of three 1s and 0s.
So no matter how big the numbers are I want to add,
I never have to do anything more
complicated than three 1s and 0s.
And this is every single option
so the reason that binary is great for
adding is, when you're adding base 10
numbers you might have to add a 2 to a 7 or a 1 to a 4 or an 8...
there's so many options that you may have to add. Binary - only those eight options.
If you can do all of those you can add any numbers together by just doing that one
step over and over and over and over and
over again
so if you can build that of dominoes,
that's one bit of the calculation. So if you built this
I don't know, four times, so if you had...
you'd probably need about 10,000 dominoes...
with 10,000 dominoes you
could build the full adder circuit four times in a row
it means you could take two 4-digit
binary numbers as inputs and you could
have the 5-digit sum coming out as
the answer.
Of course... I mean you'd have to be truly insane to phone up a series of domino manufacturers,
find a wholesaler who would ship you 10,000 dominoes, find a concrete floor at the...
well, at the museum of science and
industry in Manchester and then spend
an entire weekend
balancing dominoes. I may have done this. I got some friends together we got 10,000
dominoes and we built a circuit which
will add four digit binary numbers and
give you a five digit answer.
So if you'd like to see Matt's giant
Domino computer in action,
there'll be a link on the screen and in
the video description
it's obviously well worth a look there's
also more of my interview with Matt
where he talks about how you take this Domino idea he has just explained to the next level.
It'll probably be unlisted so having
watched this video for so long
you're in a very exclusive club that
would know about it. And finally i'm sure
some of you will be saying in the
comments,
why isn't this video on Computerphile?
Well, it probably could have been but
here it is on numberphile. Those of you who aren't wondering that because you've
never heard of Computerphile
allow me to take this opportunity to
tell you about Computerphile which is
kind of like the sister channel of
Numberphile, all about computer science
and those sort of things. It's well worth a look
and again, I'll include links there's
going to be loads of links under this
video so why don't you sort of extend it
and make that information box a little
bit bigger and you can see them all
sitting there.
