Zum Inhalt springen

4 KB to the Moon: The Apollo Guidance Computer

Zusammenfassung

The Apollo Guidance Computer (AGC) had 4 kilobytes of RAM and 72 kilobytes of read-only memory — less computational power than a digital wristwatch. It ran at 0.043 MHz, roughly 100,000 times slower than a modern smartphone processor. Yet the AGC successfully guided twelve astronauts to the lunar surface and back across six landing missions, executing real-time navigation, attitude control, and engine burn calculations in an environment of radiation, vibration, and thermal extremes. Its software, written largely by the team led by Margaret Hamilton, contained some of the most carefully engineered code ever produced.

The Hardware Constraints

The AGC was designed at the MIT Instrumentation Laboratory beginning in 1961 and first flew uncrewed on the AS-202 test mission in August 1966. The constraints it operated under were unlike anything in civilian computing:

  • Weight: The entire computer — including power supply, housing, and display unit — weighed 70 pounds (32 kg) and occupied a volume of roughly one cubic foot.
  • Power: Maximum power consumption was 70 watts.
  • Memory: 2,048 words of erasable magnetic core RAM (each word 15 bits + 1 parity bit), and 36,864 words of fixed rope-core ROM.
  • Clock: 1.024 MHz crystal oscillator; instructions executed at roughly 0.043 million instructions per second.
  • Reliability requirement: The AGC had to function after exposure to radiation doses from the Van Allen belts that would degrade conventional transistors.

The ROM — core rope memory — was literally woven by hand. Wires were threaded through or around tiny magnetic ferrite cores, with a wire through a core representing a 1 and a wire bypassing it representing a 0. Each rope was woven by specialized workers, primarily women, at Raytheon Corporation. A programming error discovered late in development could require weeks to manufacture a new rope.

The Software Problem

The ROM constraint produced the most significant challenge: every byte was precious. The AGC’s software — the real-time operating system, navigation algorithms, attitude control, engine burn calculations, rendezvous guidance, and emergency procedures — had to fit in 36,864 words. Margaret Hamilton led the software team and introduced the term “software engineering” partly to argue that the intellectual work of writing correct, reliable software deserved the same rigor as hardware engineering.

The software accomplished things no computer of comparable power had attempted:

  • Real-time trajectory calculations using inertial measurement data.
  • Multi-task scheduling on a computer with no operating system primitives beyond a simple priority interrupt scheme.
  • Graceful degradation: the AGC’s executive scheduler could shed lower-priority tasks when overloaded, allowing the highest-priority functions (attitude control, engine firing) to continue.

The 1202 Alarm

During the Apollo 11 landing descent on July 20, 1969, the AGC began issuing 1202 alarms — “Executive Overflow,” meaning the computer’s task scheduler was overloaded. The rendezvous radar had been left in a position that fed the AGC a steady stream of spurious cycle steals — roughly 13% of the processor’s capacity — on top of all its guidance tasks.

Flight controllers at Mission Control had roughly three seconds to decide whether to abort the landing. 24-year-old software engineer Jack Garman had a card in his pocket with AGC alarm codes and their meanings. He told controller Steve Bales: a 1202 means the computer is restarting and recovering. As long as it keeps restarting and the alarms are not continuous, you can continue. Bales called “GO.”

The AGC’s priority scheduling shed the lower-priority tasks and kept the critical guidance computations running. Armstrong and Aldrin landed safely. The 1202 alarm is a case study in exactly the kind of graceful degradation the software team had designed for.

The Legacy of Constrained Engineering

The AGC’s constraints produced software engineering practices that influenced the field for decades. Working under conditions where a single wasted word might mean redesigning a core rope, the programmers developed habits of extraordinary precision: formal verification of critical routines, exhaustive testing against simulated mission profiles, and documentation standards that treated code as a first-class engineering artifact.

Modern spacecraft have enormously more computational power than the AGC, but the real-time embedded software tradition it initiated — careful, verified, documented, priority-scheduled — lives in the aerospace software standards DO-178C and in the practices of safety-critical software engineering worldwide. The context is developed further in The Embedded Systems Story.


📚 Sources