Ada Lovelace

From Conservapedia
This is an old revision of this page, as edited by Ed Poor (talk | contribs) at 04:36, April 15, 2011. It may differ significantly from current revision.
Jump to navigation Jump to search
Ada 1838.jpg

Augusta Ada Byron (1815-1852) is best known for having studied Charles Babbage's plans for the Analytic Engine and with Babbage and others wrote out some computational algorithms intended to run on it.

Although modern feminists have presented her as "the first computer programmer"[1], there are diverse opinions on this. For one thing, the computer Babbage conceived had never been built.

The argument rests on the claim that she was first to publish a paper (in 1843) containing a mathematical algorithm encoded for the purpose of being executed by an automatically controlled digital computer.

  • In October of 1842 Luigi Federico Menabrea (1809-1896), an Italian professor of machanics at University of Turin (and later premier of the Kingdom of Italy), published a paper describing the function and theory of Babbage's Analytical Engine.
  • Ada translated the paper from French to English and added her own extensive comments. (See Science and Reform, Selected Works of Charles Babbage by Anthony Hyman.) This was published in 1843 and impressed Babbage for it included, as Babbage himself wrote,

some complicated programs of her own, the most complex of these being one to calculate the sequence of Bernoulli numbers. For this reason she has earned the reputation for being the first computer programmer. (Though, of course, Babbage and others also had written “programs” for the never completed Analytical Engine.) [2]


That computer was the "analytical engine" designed by Charles Babbage. It was never built, because Babbage's design was way ahead of its time. The program calculated Bernoulli numbers. (Babbage undoubtedly also wrote some "code" as examples for the analytical engine, but it wasn't published, and it didn't perform a recognizable function.)

Ada had to write the algorithm on paper, rather than at a keypunch or computer terminal, of course. But she actually, to use modern terminology, "wrote code". Also, since the term "program" had not been coined, she described her algorithm as a "plan". In the 20th century, the program was carefully analyzed and simulated, and found to have a minor "bug". In 1983, a team of researchers at United States Department of Defense designed a computer language named Ada. It is not widely used.

Early Life

Although she was the only legitimate child of of the famous British poet Lord Byron, she had virtually no relationship with him, given his death when she was only nine years old.

She was born Augusta Ada Byron, and called by her middle name as a child. She married William King, who later became Earl of Lovelace, making her "Countess of Lovelace". She has been called Augusta Ada, Augusta Ada Lovelace, Ada Lovelace, Ada King, or just Ada.

What did Ada's Bernoulli program look like?

The program, and detailed technical commentary, appeared in a paper "Sketch of the Analytical Engine Invented by Charles Babbage" that Ada wrote in 1843. The program itself has been reproduced in the "sidebar" on page 79[1]. First there is a list of the six input and output variables that are used: V1, V2, V3, V21, V22 and V23. And the temporary variables V4 through V13. In modern terminology in a strongly typed language such as C++, we would write something like:

  int V1, V2, V3;         // inputs
  int V21, V22, V23;      // outputs
  int V4, V5, V6, V7, V8, V9, V10, V11, V12, V13;   // temps

At the start of the program, she gives initialization of V1=1, V2=2, and V3=N. (Modern computers often have "immediate" instructions to handle constants without using up registers.)

Then she lists the 23 instructions, giving their source and destination registers, opcodes, and commentary on the progress of the program. The first 5 intructions, for example, are:

  V4=V5=V6 = V2 * V3;       // Get 2N.  The machine allowed multiple destination registers.
  V4 = V4 - V1;             // Get 2N-1.
  V5 = V5 + V1;             // Get 2N+1.
  V11 = V4 / V5;            // Get (2N-1)/(2N+1).
  V11 = V12 / V2;           // Get (1/2) * (2N-1)/(2N+1).

(She used the old-fashioned multiply and divide signs "" and "". These seem quaint by today's standards, but they were the symbols that people used at the time. Neither the 026 keypunch nor the ASCII character set had been invented.)

She used two loops—see the other sidebar on page 78. V10 is the outer loop counter. The loop consists of instructions 13 to 23. It continues until V10 counts down to 1.

Was it a computer?

The "analytical engine" was so far ahead of its time that one might be tempted to call it just a "visionary idea". The technology of the time was nowhere near capable of building it. Even the much-less-ambitious "difference engine" was beyond the technology of the day—making the counters do arithmetic reliably required very careful machining of the parts. Only a small partial prototype of the difference engine was built in Babbage's lifetime. But Babbage clearly knew what he wanted[2]. His vision of a calculating device that can perform operations under control of a "program" punched into cards, and that makes control decisions based on the data resulting from the calculation steps, was incredibly prescient. It was exactly the principle used in modern computers. Lovelace understood that vision, and even extended it to the idea that computers might perform tasks beyond purely numerical ones, such as composing music. The fact that the analytical engine was mechanical rather than electronic did not make it any less a computer. It just made it harder to build. It took about 100 years for the field of electrical engineering to make computers such as that envisioned by Babbage realizable.

Was it a RISC machine or a CISC machine?

From looking at Ada's program for Bernoulli polynomials, it is clear that the machine did its calculation by manipulating numbers in specific registers. It did not have any "random access memory" that could be addressed. CISC machines address memory in their operation instructions, while RISC machines operate on registers, loading and storing memory locations only with specific instructions. So the analytical engine would have to be classified as a RISC machine in that sense.

Was Ada's program a real program, or just a "description of an algorithm"?

It is impossible to answer this to everyone's satisfaction. She certainly didn't punch it on cards or type it into a computer terminal. (She might conceivably have punched it onto cards if Babbage had made his design sufficiently concrete as to assign binary opcodes, but he never got anywhere near that far.) Since it never ran on a computer in the form in which she wrote it, it could be argued that it wasn't a program, but was merely an algorithm. But, whatever it was, it was written in the peculiarly stilted language of computer machine code. That is, the numbers that it was manipulating were assigned to specific registers. As the iteration loop cycled around, those registers were overwritten with new values. That is not the way ordinary mathematical algorithms are expressed. They are expressed in terms of more abstract formulas and recurrences. In Ada's case, the formulas were broken down into individual operations, manipulating specific registers that she specified. The recurrence was specified by manipulating a count register and testing whether it had reached zero.

Algorithms like Euclid's algorithm or Heron's formula, or even integration techniques or the description of the factorial function, are not described that way unless one is writing a computer program.

"Algorithms" for calculating Bernoulli numbers had been known for some time. But she wrote this "algorithm" in the form of specifically realizable numerical operations that she (naively, Babbage's design was far beyond what the technology of the day would have provided) believed the analytical engine could have done. And she used the specific ability of a calculating device to make control decisions based on the data.

Was Ada really first? Was the Bernoulli program the first program?

There are those who claim [3] that Babbage himself, or an assistant of his, or perhaps some of his sons, must have written "programs" before Ada did. Issues like this arise from time to time, perhaps most notably in the "calculus war" between Newton and Leibniz, or the "non-Euclidean geometry war" among Gauss, Bolyai, and Lobachevsky. The scientific community generally gives great weight to the act of publishing one's work. If these other people wrote programs before Ada did, they don't seem to have published them, and they are lost. It is not known what problems these earlier programs might have been solving.

References

  1. ↑ 1.0 1.1 Scientific American, May 1999, pp76
  2. ↑ That Babbage knew what he was doing is attested to by the fact that his full difference engine was finally constructed in 1991 (the bicentennial of Babbage's birth) and is on display at the London Science Museum. Babbage's original plans were almost exactly correct.
  3. ↑ [1]