Well, today we're going to talk about the Analytical Engine. We've already got
footage "in the can", as it were, about the principal people involved in this:
Charles Babbage, Ada Lovelace. The important thing now, I think, is to just
give you the most general overview about how this Analytical Engine would have
worked, if only it had ever been built. At the Ada Lovelace symposium, December
2015; 200th anniversary of her birth; I actually met up with Stephen Wolfram - of "Wolfram [Language]" and
"Mathematica" fame who has done a very good blog on Ada Lovelace - computer programmer.
There's also -- you'll see it in the Info Block again -- a link to all the lectures
given at that 200th Anniversary Symposium. Last but not least - and it relates to
this picture we're using here - one of the lectures there was by Sydney Padua, who
is a very, very talented graphic artist. She turned her attention to actually
researching the Babbage-Lovelace story and has done the whole thing in a
hilarious comic book. She envisages, as you see here. Lovelace as this
impossible, detached heroine - but fearfully bright -
Babbage's faithful assistant. Here's Charles Babbage: short-tempered, thin-skinned,
exactly like the real Babbage! But, thanks to Sydney
we're able to actually have a picture here that I can talk to; of what the
Analytical Engine will have to look like should it ever be built. It may get built
but it'll be years - it'll be decades before it's ever built - because one has
to understand all of Babbage's notation, in his technical drawings, and that's no
mean feat. Anyway, Sydney has decoded enough of what must
happen. Here it is - it's fantastic! This is the Analytical Engine, as it would have
been. I'll try and interpret this for you in modern terms. This - sort of - almost
amphitheatre thing - at the end here - that's the CPU ! This is, as it were, your
Intel chip at the end of this thing. The whole corridor-looking thing of stuff
behind her, with a proud Babbage standing beside it,
that's the memory! And if you look more carefully at this you'll find that the
memory consists of thousands of positions, each of which can hold a 50
decimal digit number. Binary had not occurred to mathematicians even,
in the early 19th century - in saying that I do know that the mathematician
Leibniz was aware of it - but you can see that even if Babbage had been aware
of it - actually the temptation will be stick to what you know. "We're here to do
generalized arithmetic and we all know and understand decimal!" So, yes, it's a
decimal machine - 50 decimal places. Every time you want one of these numbers
there's an elaborate mechanical way to fetch it into the CPU and just look at
the CPU itself! If it has got to store these numbers, temporarily, before it
adds them, or something like that, then yes, you're going to have yet more of these
50-digit columns, inside here, to hold the numbers that are in the process of being
processed. Roughly speaking this memory, for the
machine as designed, was seven metres long and the whole thing was three metres
high. It's the most enormous thing! Could you
drive this with a handle, by hand? Not a chance! Little picture here that
Sydney's put in of a steam engine. Babbage was going to drive the whole
thing by steam! For those of you who aren't perhaps up with the history of these things
please remember this is the 1830s and 1840s. Faraday's work on electromagnetism
was just about getting under way. But any idea of having electric motors and mains
electricity to drive this thing? Not until at least the end of the 19th
century, turn of the 20th, when this kind of thing would become possible. So, yeah,
you wanted to drive this thing? The only option would have been steam. Way
beyond even a gang of humans - to turn all these cogs. So number one, it says
here, The Store. Do remember that in English notation, for computers, even as
late as the 40s and 50s we in the UK used to call it Store. In the US
it was always called "memory" on IBM machines. American usage has become
universal. We now call that memory. Equally very early papers on computing,
in the UK - certainly Babbage - this CPU he called "The Mill" because you put the
numbers in, you mill 'em om around and you add and you
subtract them, and whatever. They get, y'know, know, roughed up and knocked into an
answer. It was called The Mill. So, that's the only bit of translation you really
need. So, where's the program stored? Is that
stored in this memory here? No, it isn't, the idea was that this - the
cards that drove this thing - would be based on well-established and very
reliable Jacquard loom technology. Jacquard looms weave [silk and] lace and they are
programmed to get the right pattern in the lace by having a set of cards that
go over sensing rods. And the sensing rods, basically, every time they sense a
hole do a stitch at that position. Roughly speaking. So by putting different
hole patterns on different cards and having a succession of cards, just like a
succession of instructions in the program, you could get a beautiful
pattern to appear on your lace machine. And there were even card punches
available for preparing Jacquard cards, which I think are roughly about 30
centimetres long. Something like that. So this was not a flight of fantasy this
was building on existing technology. You can go to a Jacquard Lace museum, in
Macclesfield, here in the UK. You can see all of this in action. You might say "Well,
how do you keep the sequence, then, of the program instructions on the cards?". You
sequence them by tying your Jacquard cards together with binding cords, down the
sides. When you go on to the next card you don't have to feed it in separately. It's
pulled along in, by the cords that bind the sides of all the cards together. This
most amazing machine was Turing Complete. Now, I've done a video on Turing
Complete and what's the requirements for Turing Complete? Number one - you've got
to be able to have an arbitrary amount of memory. Well, in principle, on this, you could.
Number two - you've got to have a conditional branch statement. You've got
to [be able to] say "If this piece of data is this then do that, else do this". Two possible
routes through your program. Amazingly Babbage's Analytical
Engine has got 'if' statements built into it. And, going along with that, whichever
way you go on the 'if' statement, might need you to do, as it were. a 'goto' to a
different instruction. It was all done on these cards. If you wanted to go to an
instruction ten ahead [of current position] then the machine had to arrange to just slip ten cards on.
Bump! Bump! Bump! Count to ten, and then "Ding!" Up would come the sensor rods on the 11th card.
You've done your jump. And as part of being able to do a jump
why can't you jump back earlier? In other words, do a loop?
Yes, of course, if you can do an 'if' statement you can jump backwards. You can do loops.
And this [AE] could, and did, do loops as well. Was he a complete genius did he realize
what he was doing? Or did he just accidentally do the right thing? But this
is the thing remember, the program is not stored in the same place as the data, as
it would be on a modern von Neumann computer. They're both in RAM. I mean, great steps are taken
[by the OS] to protect your program from being over-written once it's known that that's where
the program is. But, in principle, they
both [program and data] sit in the same technology. Whereas, here, it was moving about with your cards,
shuffling them backwards and forwards, that caused the jumps and loops. So what
else did this have? Well, it did have the ability to store numbers anywhere in
memory so there was a crude addressing system of sorts. It did have
the ability to read in a number off so-called 'number cards'. So if you were
to say: "Let's add three plus five" where are the 3 and the 5 going to come from?
Well, the easy answer would be: "Get them from number cards". So, you put an
instruction here, in your program, saying "read next number card" and the number
cards here, which are at number 7 [see figure]. you would read in. And you say: "Ooh! that's
interesting! That's a three!" and you can then either keep it in the CPU and read
in the next card or, if you wanted to, optionally, you could store the three and
the five in memory. Now if you decided to store
them, and keep them for later, the most amazing thing had to happen was that you
had to take a copy of what is in the column here, representing number three
and transfer it to the place in store where you want to hold it. In other words it's
the data bus: stuff being pulled in and pushed back out. And in
typical Victorian style it's not called the data bus;
it's called the Ingress Axis and the Egress axis. Now the Ingress Axis was
for reading stuff in from store, memory, and the Egress Axis was for storing it
back out again. But - and my mouth dropped open - I mean "How is that
mechanically done?!" And the answer is with racks and pinions like you've never dreamed
off in your worst nightmares. Because this is 7 metres long and the only bit
of vacant memory [say] is down at the far end. You've got to transfer the number 3, seven
metres down to be stored. Just imagine these cogs and racks going "BRRRRR!!!!"
like mad, and transferring the 3 down to the far end. But you could. You can store
the 3; you can store the 5 if you want to. But you would retain copies in the
CPU and you would add them together. The addition was done by the barrel
controllers here, that's part of the CPU, and corresponds very closely to what's
sometimes called the Microprogramming Level inside a CPU. Again, for those of
you who know about the era when CPUs were really like 'computers within computers'.
They were easier to program that way rather than doing hard-core 'close to the
metal' logic. [You] used to have the ability to be able to write a 'program within a
program' as to how to do an addition, within the CPU. Now that is the basis on
which this is done. There are sets of barrels with pegs coming out of them
which, if they rotate around in the right way and read the two numbers that you
put in, 3 and 5; you call up the addition barrel which swings around on
lots of levers and says "I am the addition barrel",
reads off the two numbers - there's lots of other complex stuff inside there
because it's like an Arithmetic Unit built in there as well - comes to the
conclusion the answer's 8. And then posts the answer back out,
optionally, if that's what the program cards say to do. So it's all kind of
functionally complete there'd be an adder in there, there'd be a thing for doing subtractions and
so on. But the operations of it are really very, very well known to us. There
are other things in here called 'variable cards'. Those really were to stipulate
where things might be stored. You might have a 'read a number' card but you would
then, optionally, read a variable card to discover which location it's to be
stored in - if you want to keep a permanent copy. So you can imagine that
writing programs for this thing was not just getting the instructions right but
also realizing that sometimes you might need to do what we call a STORE
operation in assembler-level programming Well, that STORE operation required you
to read yet another card from this stack to find out where to store it. During the
era where he [Babbage] was in charge of supervising hand-produced logarithm
tables it was the printing that was always
the problem! Typos crept in! People sent him flame-notes saying: "I bought your
seven-figure log tables and there's the following 50 errors!" So he always wanted
his machines, if ever they got built, to have printers built in at the back. So buried
around at the back of this, yes, there is a printer that could print
out the answer and make a permanent record.