A demo of Charles Babbage's Difference Engine

Alan demonstrates the reconstructed Difference Engine No. 2, Charles Babbage's 19th-century calculating machine. It solves polynomial equations through mechanical carries and pipelined addition, then prints the answer using a stereotyper that creates molds for movable type. Four hand cranks produce one answer.
Foreign. Well, welcome. My name is Alan. My name is Alan. I'm a volunteer docent here at the Computer History Museum. And I'm going to tell you the story of the man, Charles Babbage, his machine designs, and how this amazing machine behind me happened to get built and come to our museum. Julie, standing down here by her crank is the power supply of this machine and takes a lot of skill. She's very skilled at managing the various load on this crank. And she has to crank very steadily because there's a lot of stuff going on. And you'll be fascinated, I think, with the story of Babbage and his ties, because you probably all know what it is to come to sort of develop something a little ahead of its time. So this is a story very, very familiar to some of us. So before I even begin talking about it, it's good to study it as a moving sculpture. So let's let Julie crank it through about five cycles here and you guys can look in it if you have a. We only have about 45 seconds, but you should kind of rotate around and go look at the back happening and come back here in front of me in a few seconds and we'll talk about it. So let's just make it move. I'll get out of the way it. All right, come on back around to the front. We'll talk a little bit here. Now, in that little brief time, Julie was solving an equation, what we call a fifth order polynomial. She did it five times in that amount of time while we were watching the machine. And this machine is based on a mathematical principle called finite differences. And we're going to talk about that a little later. But first let me back up to talk about the inventor. Charles Babbage was born in England in 1791, son of a London banker. He was sent to university, very well educated in mathematics and science. And if you look at the beginning of the 19th century, scientists were multidisciplined. That is today we have this amazing specialization. But back then, scientists and mathematicians dabbled in a lot of different areas. And Babbage was one of those who we might call today a sort of Da Vinci man. He had lots of great ideas and some of them got executed. And for example, he invented the ophthalmoscope that physicians look into your eyes with. That was complicated, but he also invented a simple thing called the cow catcher that goes on the front of locomotives. He also invented a semaphore signal to communicate between ships at sea and lighthouses. Very, very clever guy on the Other hand, like some residents of this valley I know he wasn't great at communicating with other carbon based life forms. He had a really kind of curmudgeony personality that got him in trouble, especially if you disagreed with him. And it wasn't only in science and mathematics that that happened to give you an idea, an insight into his personality. I just want to read to you a letter he wrote to one of his contemporaries, the poet Tennyson, criticizing one of his poems and asking him to please change it. The letter reads, sir, in your otherwise beautiful poem, the Vision of Sin, there's a verse which reads, every moment dies a man. Every moment by one is born. It must be manifest that if this were true, the population of the world would be at a standstill. I would suggest this is chutzpah. I would suggest that the next edition of your poem, you have it read, quote, every moment dies a man. Every moment one and one 16th is born. So that gives you a little clue into this sort of geeky personality here. Okay. The story of the machines really begins in the early 1820s, when Babbage and a colleague have a project to review various publications of books of mathematical tables. Now, you all look almost old enough to remember the days when we had to use a slide rule in these books to solve some of our problems, to look up natural logarithms or, or common logarithms, tables of integrals, trigonometric functions. And of course, Britain was the king of the seas, the world's superpower at the time, using astronomical tables to navigate on the ocean. Well, when he and his colleague looked at various publications of these books, what do you think they found? Yeah, one book was different than the next. Where is the error? That's the question. Babbage immediately said, we gotta think of a way to recalculate these tables infallibly. After all, this is the industrial revolution. We're inventing railroads and factories, machinery of production. Surely we can figure out a way to do this. And he drew up a machine which today we call difference engine number one. It relied on this principle of finite differences to solve up to seventh order polynomial equations. And he then, once he had it drawn up, he needed the next thing an entrepreneur needs to bring his device to reality, which is money. There were no venture capitalists in England in the 1830s. So he went to the funder of last resort that everybody loves to get money from. The government, the crown. And they indeed said, okay, we will fund it. A very, very loosey goosey contract, by the way. And Charles Babbage then needed the next ingredient, which was a very skilled machinist, toolmaker, because you have to remember in those days there were very few standards. How do you make gears? Reliably, there were no standards for screw threads, all that stuff. So he found a very good tool maker who was. Because he was a very good tool maker, he was also a bit of a prima donna. So you can imagine these two guys communicating. First, difference engine. The only thing that he ever built was a small demonstrator model which is reproduced in a case over there, if you had a chance to look at it, so he could demonstrate it at parties and when he was out trying to raise money for the project. So he moved on, though, he kept inventing things and he went to work on a much, much more ambitious project. You think he would scale down. He scaled up. He drew up the analytical engine, which was a full scale computer, mechanical computer that could add, subtract, multiply, divide, branch. Be programmed with punch cards. Yes. 1830s. It was an amazing machine. It would have been bigger than a locomotive. So I don't know how we ever thought anybody would build it, but it was a good mental exercise. Probably one of the largest mechanical devices ever envisioned by man. Next, while he was doing that, he thought he had a better idea for building the difference engine with fewer parts. And he designs difference engine number two in great detail. It has only a mere 8,000 parts. And he offers it to the British government and they politely refuse. They say, we've moved on, Charlie. We already gave you enough money to build 20 locomotives and we didn't produce anything. So that's the end of it. Charles Babbage, during his life, never built any of these machines. He said, another age, you'll have to judge whether any of them would have worked. Fast forward 1985, 130 years later, roughly. The curator of London Science Museum, Doran Swade, has Charles Babbage's drawings for difference engine number two. And he says, I wonder if it will work. Let's try to build it. And they embark on a similar odyssey. Money, Time. Machine shops so that in 1991, Babbage's 200th birthday, they have the calculating set of the part of the machine built from where Jolie's standing through here, where you see 8 registers, 31 digit number registers, vertical registers of numbers, so that you can have seven different columns plus the result column. But the most important part of the machine, Babbage felt, was this part down here, which is the printer stereotyper. You see, anybody can do the math with finite differences and solve the equations. But how does one make sure that after that you don't make a mistake? Because if you write down the answer, people sometimes reverse digits. Then you give it to a printer who's using movable type, right? Very easy to mess that up. So he wanted to make sure that that didn't happen. This device takes the result from this register, transfers it to this printer here. You'll see the type wheels rotate, a little inker comes up, puts ink on the type. The paper is brought up to the printer and prints the answer. You won't see that actually print because we don't like to mess this thing up with the ink. It works like a printing press. Then most importantly, this tray down here would be filled with a plastic material like plaster or paris. Right after the print cycle, another set of type rotates down, impresses the answer into the plaster, the device, the tray is indexed in, waiting for the next answer, etc. Until the page is full, the mold is full, a printer takes it, pours lead in there, has a printing plate, no movable type. So he did everything he possibly could to avoid error. And believe me, unless this machine is broken or jammed up, it cannot produce a wrong answer. So now, as I said, by 1991, the museum had built this calculating section. How were they going to finish it? Their plight is seen by an American entrepreneur named Nathan Mirvold. He was once the CTO of Microsoft. He's running a very interesting company up in Seattle. Now, I noticed they're just inventing a laser beam weapon that zaps mosquitoes that carry malaria. I'm not making that up. It works. I've seen it. You've seen it work? Okay, great. So anyway, he says, I'll tell you what, London Science Museum, I'll fund you to finish Difference in this first serial number one. But then I want you to build me a whole difference engine for my private collection. And this machine you see is Nathan Mehrvold's difference engine number two, completed in March of 2008. And he's letting us keep it here to show it to you folks for a while, I hope. A long while, I hope. And afterwards, we're going to take it up and stick it in his living room right next to the T. Rex skeleton he's already got. So, okay, so let's now look again. Let's crank it. I want you to watch as the addition takes place. We've got this equation set up so, in fact, we're using five of the seven Difference columns. And you will see the addition taking place by these big sector gears in between adding the numbers from one column by rotating them back towards zero value, transferring their value to the next column, and then resetting the column to its original value as it comes down. For that reason, these columns jump up and down. Go ahead, Julie. You will also notice. You will also notice this clanking sound. That is the sound of these big interlocking. You see that run completely up and down the column snapping in. Because when that. When you don't want those columns to rotate, you don't want them to drift in between two numbers. So that lock comes in, locks up the column, resets all the neatly. So you have digits on every column. And then you will see the print cycle happen. The type is going to rotate in a second. There's the rotation print stereotype. The tray index is in. Watch the next one come up here. There's a rotational type ink print stereotype. Now, when this tray gets to the end of the column, it's automatically programmed because it will come zipping out, rotate across, ready for the next column. Not only that, there are two of these trays in here. Babbage wanted two different sizes for the books or two fonts, one this size and one big. In addition, what happens when this tray is full? Julie's way down here. You don't want to overflow this thing, right? So there's a little weight dropping down, down here, which is pulling on this piece of catgut which comes up here across the machine to a little paw. When that tray fills up, it's going to shut off the machine by disconnecting the crank. The crank. That means you got to come down here and change this tray. We thought of all these things. Okay, now we're going to go around the back and Julie's going to crank it some more. And we can look at one of the more mesmerizing parts of this machine. So let's, let's go around back. How long does it take to learn to do this? You need to be friendly. You can't see it on the edge. Okay, let me get out. Let me get out of the way. Go ahead. So what the heck is going on here? This is not a DNA model. He would have really ahead of his time if he thought of that. The biggest problem in designing calculators in the 1800s was how do you carry when you're reigning? You go past nine on a column starting on the right, you gotta carry the one. Those mechanisms work, believe it or not, a little Difficult to design because you have to carry all the way across. I remember my odometer sticking to my car, which got the 99,999. There seemed to be not enough energy to push them all over the top. What happens in this machine is he was very clever about managing the engine energy. When one of the bottom wheels, or less significant wheels, goes from nine back to zero, a tab on the wheel energizes a little mechanism here and it protrudes out. Then at the right part of the cycle, that will happen up and down the column. At the right part of the cycle, we start from the bottom with these hooks. They come around. If that thing is worn, saying, I need to be carried. The hook engages another mechanism and pushes the wheel just above it by one digit. If that happens to go through nine for time, that'll be activated and the next one will be and right up the column. So if you're a computer person, we're polling the register for carries, right? And that's exactly what happens. In fact, you could call the carry warning sort of a primitive flip card because we activated it. Until it's reset, it stays there. So we got all these. In addition, to use keep on with the computer parlance, he figured out that it would take too much energy to add all these columns at one time. So he pipelined the machine so that odds are added to evens in one part of the cycle and evens to odds in another part of the cycle. Even so, the energy Julie puts out varies considerably over the cycle. So it takes some talent to keep up that pace, which is very steady cranking. Otherwise things jam up on us. Okay, one more thing. You can all turn around and see this board. I think you've all got a little algebra, so you won't. Won't lose you here. How does finite differences work? Just a quick illustration of how finite differences work in solving equations. Here is a simplest I could think of. Result equals x squared plus 1. In order to program that machine, what we have to do is solve these polynomial equations manually. N + 1 times 1 more than this exponent. So in this case, 3 times. I've got to do it manually, so we can do that together. If x equals 0, the result is 1. X equals 1. If result 1 squared plus 1 is 2, 22 squared is 4 plus 1 is 5. Right. Now I subtract the first two solutions and put the difference in difference column number one. The next two subtract difference column number one. Then subtract the two first. The first two differences put it in difference column number two. Notice I for a second order equation, I wind up with a a constant in difference column 2. For a third order equation, I would wind up with a constant in 3. For a fifth order equation, I would wind up with a constant in difference column 5. I then take these numbers with some adjustment because of this polling, and we manually boot them into the machine. There's a process for us manually turning the wheels, setting them to those initial differences. From now on, it's we only have to add to solve for every sequential value of the unknown x. Want the 2 +3 equals 5. 5 +5 equals 10. X equals 4. 2 +5 is 7, 7 and 10 17. It'll work for any polynomial equation. So if you look at the machine now and can read the numbers, you'll see the difference. Column number five, remember, remains a constant on the machine. All the other numbers are changing. Questions about that. Okay, so let's go back around front here. The museum in London always voted on whether this was was game changing. In other words, is the concept of the machine wrong, or are we just fixing something that engineer Charles Babbage and his excellent machinist would have said, well, that's obviously wrong. We got to fix that. So that's the way some of these fixes got made. Some of them were fairly large, some of them small. One of the most obvious is Charles Babbage envisioned cranking this from this big Top Gear, meaning that one revolution of the crank would give us one answer. Unfortunately, Julie hasn't the strength to propel the machine from there, and neither did anybody at the museum. So they put a 4 to 1 reduction gear in here. That's why we have to do four revolutions of the crank to get an answer. Four revolutions of the crank, eight seconds for four revolutions. If anybody wants to calculate millions of floating point operations per second from that. So there are several of those little things in the machine. The other thing I'd like to just mention before we finish is what's the impact of Charles Babbage's machines on computing history? That's why we're in business here in this museum. And there's a lot of the same about that. Lots of books about Charles Babbage and his influence. My view is, after reading some of them, that it's not huge because, and you can relate to this, I think he was so far ahead of his time with this, and he never built the machine. So people did not build on that technology. Much later in the century, others knew that these machines could be made and kind of started, took off on it. But that really lessened his influence on history. However, he did have a young female protege by the name of Ada Lovelace. Ada was the daughter of Lord Byron, the poet, but her mother didn't want her to be a poet and shoved her into math and science. Very unusual. And she really was enamored with Babbage's queen ideas. Not with Babbage, by the way, so. But she was very inept with this project. And she at one point wrote a paper commenting on a French paper where she. And she said, gee, I realize that these are only numbers on these machines, but that number could represent a character in the Alphabet as well as it can represent a number or it could represent a symbol. And I've envisioned that we'll be able to program these various devices to manipulate symbols, characters and words. So there was a little vision there, but otherwise it took way into the later part of the century for people to start building reasonably priced, smaller calculating machines, of course. So we're going to crank it once more, and then we'll be hanging around here. If you guys have any questions, let's go and take it all in. Now that you know how it works, works and see what's happening. It.
More from Robert

45: Sandy Carter Unveils the Future of AI: Myths, Agents, and Creativity | SXSW Insights









