Analytical Engine: the Orig- Inal Computer
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 2 Analytical Engine: The Orig- inal Computer As we learned in the fourth grade science course, back in 1801, a French man, Joseph Marie Jacquard, invented a power loom that could weave textiles, which had been done for a long time by hand. More interestingly, this machine can weave tex- tiles with patterns such as brocade, damask, and matelasse by controlling the operation with punched wooden cards, held together in a long row by rope. 1 How do these cards work? Each wooden card comes with punched holes, each row of which corresponds to one row of the design. In each position, if the needle needs to go through, there is a hole; other- wise, there is no hole. Multiple rows of holes are punched on each card and all the cards that compose the design of the textile are hooked together in order. 2 What do we get? With the control of such cards, needs go back and forth, moving from left to the right, row by row, and come up with something like the following: Although the punched card concept was based on some even earlier invention by Basile Bou- chon around 1725, “the Jacquard loom was the first machine to use punch cards to con- trol a sequence of operations”. Let’s check out a little demo as how Jacquard’s machine worked. 3 Why do we talk about a loom? With Jacquard loom, if you want to switch to a different pattern, you simply change the punched cards. By the same token, with a modern computer, if you want it to run a different application, you simply load it with a different program, which used to keep on a deck of paper based punched cards. That is why Jacquard’s machine is considered to be an important step towards the creation of the modern computer as we know it. 4 How did the AE get started? On June, 14, 1822, the English mathematician Charles Babbage proposed a steam driven cal- culating machine based on the decimal num- ber system, which he called the “Difference Engine”. This machine would be able to compute tables of numbers, such as logarithm tables. He ob- tained government funding for this project due to the importance of numeric tables in ocean navigation. Let’s check out Charles Babbage’s life and his machines. 5 Who was the sponsor and why? As we all know that, by promoting their com- mercial and military navies, the British gov- ernment had managed to become the earth’s greatest empire in the late 16th and early 17th centuries. Around the time frame of Babbage’s proposal, the British government was publishing a seven volume set of navigation tables which came with a companion volume of corrections, show- ing that the set had over 1,000 numerical er- rors, due to perhaps the complicated and bor- ing nature of the calculation. On the other hand, such calculations are all governed by rules, thus “mechanical”. It was hoped that Babbage’s machine could help to eliminate errors in these types of tables. 6 It did not work out.... Unfortunately, construction of Babbage’s Dif- ference Engine proved exceedingly difficult and the project soon became the most expensive government funded project ever. (More ex- pensive than the “big dig”?) Ten years later the device was still nowhere near its completion, when the funding became thin. This project on the Difference Engine was never completed.... 7 ...until now Nevertheless, based on Babbage’s original plans, the London Science Museum did construct a working Difference Engine No. 2 during the pe- riod of 1989 and 1991. It later secured further funding to build another machine. This machine, as shown below has been on display, since May 10, 2008, in the Computer History Museum in Mountain View, CA. Let’s have a look at how Babbage’s Difference Engine No. 2 should have worked, as it sits in the Computer History Museum. 8 AE came into the scene Babbage did not give up. Instead, he proposed the next machine, the famous Analytical En- gine, which is an important step in the history of computers. It was first suggested in 1837, but Babbage continued to work on the design until his death in 1871. Below shows a “renovated version” of the ma- chine. 9 It goes again.... Because of financial, political, mechanical and legal issues, the engine was never completely built. Some also believed that the technological lim- itations of the time were a further obstacle to the construction of the machine; others be- lieved that the machine could have been built successfully with the technology of the era if funding and political support had been stronger. Moreover, Charles Babbage was notoriously hard to work with and alienated a great number of people who had at first supported him, includ- ing his engineer Joseph Clement. Thus, his personality might also have played a part in the failure of this project. 10 Analytic Engine and Computer The design of the Analytical Engine was quite similar to that of the general-purpose comput- ers, completed about 100 years later in the 1940’s, in sense that it can execute many dif- ferent programs to serve varying purposes. This device, large as a house and powered by six steam engines, would be general purpose in nature because it would be programmable, thanks to the punched card technology of Jacquard. Moreover, Babbage made an important intel- lectual leap regarding the punched cards. 11 Babbage’s idea In the Jacquard loom, the presence, or the ab- sence, of each hole in the card physically al- lows a colored thread to pass or stop. Bab- bage saw that the pattern of holes could be used to represent either an abstract idea such as a problem, i.e., instruction as how to solve a problem, and/or the raw data required for that problem’s solution. Babbage actually realized that, at the very bot- tom, a program can be represented the same way as a piece of data. This is exactly the same idea as we have been using with modern computers, when “coding” anything, including both programs and data, with two digits, ‘0’ and ‘1’, i.e., doing math in a binary system. 12 Here is more.... Furthermore, Babbage realized that punched paper could be employed as a storage mech- anism, holding computed numbers for future reference. Because of the connection to the Jacquard loom, Babbage called the two main parts of his Analytic Engine the ”Store” and the ”Mill”, as both terms are used in the weaving industry. The “Store” was where numbers were held and the “Mill” was where they were ”woven” into new results. In a modern computer these same parts are called the memory unit and the central pro- cessing unit (CPU). 13 What could they do? A “Store” can hold 1,000 numbers of 50 deci- mal digits each, while an arithmetical unit (the “Mill”) would be able to perform all four arith- metic operations, plus comparisons and op- tionally square roots. The input (programs and data) was to be pro- vided to the machine via punched cards, a method being used at the time to direct me- chanical looms such as the Jacquard loom. For output, the machine would have a printer, a curve plotter(drawing pictures?) and a bell (ringing for attention?). The machine would also be able to punch num- bers onto cards to be read in later, using the ordinary base-10 fixed-point arithmetic. Did I tell you the truth? Let’s check it out. 14 What else? The Analytic Engine also had a key function that distinguishes itself from calculators: the conditional statement. When we use a calculator to crunch on num- bers, we can only carry out a sequence of cal- culations. We often follow such a pattern in our life: Get up; Have breakfast; Have a class; Have the next class; Have lunch; Have another class; Have dinner; Watch TV; Go to bed; You just start at the beginning, do one thing at a time, until the end. 15 Conditional structure On the other hand, a conditional structure allows a program to achieve different results each time it is run, depending on certain con- ditions. We also make such a judgment in our lives: If it feels cold, put on a jacket, otherwise, a T-shirt. It can be represented as follows: if (if feels cold) then put on a jacket else just wear a T-shirt 16 A real example A modern traffic light at an intersection be- tween a busy street and a less busier street will leave the green light on the busy street until a car approaches on the less busier street. This type of street lights is controlled by a computer program that can sense the approach of cars on the less busier street. Whether the light changes from green to red is not fixed in the program but rather depends on the real-time traffic situation. 17 The code A control structure for the above case can look like the following: If a car approaches on the less busier street and the light for the busy street is green for at least a minute Then Switch the green light in favor of the less busier street. The conditional statement also allows a pro- gram to react to the results of its own calcu- lations. Another example would be the program that the IRS uses to detect tax fraud. This program first computes a person’s tax liability and then decides whether to alert the IRS agents based upon how that person’s tax payments compare to his obligations, thus whether sends him an auditing notice.