In Defense of the Apollo Program's Guidance Computer
By now, you've probably heard — and maybe even repeated yourself (we certainly have) — that the phone in your pocket or even a basic pocket calculator is more powerful than the computer than landed astronauts on the moon during NASA's Apollo program.
Har har, the Apollo Guidance Computer was such a dinosaur that it only had 32,768 bits of Random Access Memory and only 72KB of Read-Only Memory. Well, a traffic light nowadays probably has more onboard memory than the spacecraft that brought two astronauts to the surface of the moon in 1969 and then returned them safely to Earth.
Okay, but what about processing power? Surely, the Apollo Guidance Computer is more impressive when you consider how fast it's processing all that — oh, wait, it ran at only 0.043 MHz. That's not even a minor background process on a modern computer. Your laptop in hibernate mode is likely churning through information faster than the Apollo Guidance Computer was at full tilt.
Honestly, it's amazing the Apollo missions even got off the ground and didn't just blow themselves up on the launchpad out of sheer embarrassment.
By the specs, of course, the Apollo Guidance Computer was pretty lightweight. A modern iPhone is estimated to have 100,000 times more processing power. Its entire memory capacity is a fraction of the cache memory found in even the most budget-minded computer processors today.
Scoffing at the Apollo Guidance Computer is like rooting for Goliath because David is a weakling who can't possibly compare to such a giant. We know how that ended for Goliath.
Mocking the Apollo Guidance Computer doesn't display an understanding of modern computing power, instead, it reveals a fundamental misunderstanding of the incredible accomplishment of the engineers and computer scientists who overcame an impossible challenge — flying astronauts to the moon and returning them safely to Earth in just one decade, and starting from essentially a standing stop in 1960.
The engineers and scientists who pulled this off all but invented the technology that would get them to the moon on the fly with a degree of precision that left almost no margin for error at all. NASA engineers had to get it right the first time and, for that, they created the Apollo Guidance Computer.
This struggle to overcome the greatest engineering challenge humanity ever put its mind to, both from a hardware and a software perspective, is one of the most incredible feats of ingenuity ever accomplished and it's about time everybody recognized that fact.
You go to the moon with the computer you've got, not the one you want
Without question, if you asked Margaret Hamilton and the other software engineers responsible for getting Apollo astronauts to the moon and back, they would have loved to have more computer resources to get the job done.
They didn't, though, both because modern computers were in their infancy and because you simply couldn't fit more computer into the command module or the lunar landing module, which were both a tight enough fit as it was, and was already pushing our technological capacity of what you can shoot into space. The rocket equation was much a tyrant in the 1960s as it is today.
Instead, NASA engineers on both the hardware side and the software side had to figure out how to squeeze the most possible use out of what limited resources were available.
This involved rewriting what we knew about computer science, reconfiguring a machine designed to run a single cumbersome program from start to finish into one that could run tiny, discrete "jobs" effectively in parallel, something that wouldn't be introduced into "mainstream" computers for many years.
What's more, the Apollo Guidance Computer was capable of encountering a system error and effectively restarting a job to clear the error while picking up right where it left off in its operation, something that even today seems like a perk when an app like Photoshop or Microsoft Word offers to reopen the file you were working on when the program encountered an error and had to restart.
This feature, ahead of its time by decades, literally saved the Apollo 11 mission, as the overwhelming number of variables during the landing of the Eagle module on the moon forced the Apollo Guidance Computer to restart many times during the descent — but, it was able to pick up right where it left off and guide the module down to the surface.
The interface for the Apollo Guidance Computer, known as the DSKY (rhymes with whiskey), was little more than a ten-key numpad with a couple of function buttons thrown in for good measure. It also had to accommodate an astronaut's gloved hand, so a precision input device was out.
Fine, the engineers thought, we'll make it easy and implement a command interface consisting of a "verb-noun" pair input by numeric codes representing different commands and information. The command module even had a cheat sheet printed out beneath the Apollo Guidance Computer's DSKY interface that astronauts could refer to if needed.
Did it have iPhone levels of elegance in its human-computer interface? Hardly. Did it work? Brilliantly.
The Apollo Guidance Computer could survive where your iPhone could not
Let me tell you something about core rope memory. This little innovation, where bits of information are represented by wire threads that weave in and out of magnetic cores, is the ultimate read-only memory.
Digital bits are represented not by ones or zeroes stored in a computer's fungible memory banks, but by whether a wire loops through a magnetized ring (1) or around it (0).
Why does this matter? Well, during the Apollo missions, the incredibly harsh environment of space, including a ridiculous amount of radiation, could potentially fry the circuitry of a computer inside the command module of an Apollo spacecraft, destroying a guidance computer's ability to function.
This would have essentially marooned the Apollo astronauts in space to die alone with absolutely no way to even recover the capsule, much less intervene in time to save their lives.
How did NASA engineers prevent this problem? By turning all of the software needed to run the Apollo Guidance Computer into actual physical hardware that could not fail. So long as the Apollo Guidance Computer was powered, the computer would run any of the software in its fixed, read-only memory, thanks to this novel innovation.
Constraint: the greatest inspiration for innovation there is
The requirement that software code for the Apollo Guidance Computer is literally hardwired into the system meant "little old ladies" at a Raytheon factory actually had to weave the software written by Margaret Hamilton and her team of 350 programmers into physical memory modules.
This meant that Hamilton and her programming team had to complete the software required for the Apollo Guidance Computer many months in advance of the launch to give enough time to manufacture the core rope memory modules and adequately test them.
Before Apollo, software programming was not nearly the systematized process that it is today and, unlike today's programmers, who can program and release an app full of bugs with the intention of patching the problems later with a software update, Hamilton and her team didn't have that luxury.
"Even though common sense indicates that it is advantageous to complete something as complex and important as software long before a mission so that it can be used in simulators and tested in various other ways, software is rarely either on time or perfect," an official history of NASA computers reads.
"Fortunately for the Apollo program, the nature of core rope put a substantial amount of pressure on MIT's programmers to do it right the first time."
Hamilton's solution to this problem was a revolutionary one: treat software development with the same rigor as you would a problem of hardware engineering, and even coined the term "software engineering" to hammer home the point that their work needed to be just as precise as the work that went into the rockets that flew astronauts into space.
For NASA engineers, it wasn't enough to say that a widget somewhere in the Apollo command module was probably strong enough to withstand the dynamic pressures that come with rocketing out of Earth's gravitational pull and flying to the moon. You had to know that it was.
The mathematicians who used slide rules and calculus to plot the course Apollo missions would take to safely land on the moon couldn't wing it with their figures, they had to have the precision that the moment demanded of them.
Hamilton's entire approach to programming the Apollo Guidance Computer was that a program could not fail, and if that was not possible, then that possible failure had to be taken into account and a program written to correct anything that failed in flight.
Crucially, this saved the Apollo 11 lunar module landing as it neared the lunar surface. As the module got closer to the surface, its sensors were picking up far more data than the guidance computer could process. As it turned out, the Apollo 11 crew's checklist for the landing had them set the rendezvous radar switch incorrectly, which was sending in loads of extraneous data into the CPU and clogging it up.
While Hamilton and her team did not anticipate this exact scenario — if they had, they would have programmed the Apollo Guidance Computer differently to account for this — they did anticipate that something like this could happen, even though it was impossible to predict exactly what could happen and write code to address it.
So, they programmed a form of error correction that detected when a critical job, like the landing sequence program, was being overwhelmed and automatically deprioritized other jobs that weren't as important to free up resources for the more critical job.
In the end, this lack of available memory — one of the biggest criticisms of the Apollo Guidance Computer from more modern critics — was actually the driving impetus for Hamilton's programmers to write specific code to address generalized problems and to develop ways for the Apollo Guidance Computer to decide how to fix a problem itself that they could not predict or write code to correct for in advance.
Only the Apollo Guidance Computer has actually been to the moon — several times
Say what you will about the Apollo Guidance Computer, but for all the bluster about modern computers, only one computer in human history has actually made it to the moon and returned to Earth safely.
Sure, your iPhone has far more memory and processing resources than the Apollo Guidance Computer, but it's still in your hand right now, or in your pocket — and besides the box it came in or sitting on a desk connected to a charger, that's likely as far as it will ever go.
When was the last time your iPhone or the graphing calculator you used for your pre-Calculus course touched a human spacecraft down in the Sea of Tranquility? I thought so. The Apollo Guidance Computer hasn't just been to other worlds, it was the tool that brought humans there, to begin with, and brought them back to Earth safely.
It did so because it had a singular purpose it needed to achieve and it did precisely that, and only that, to the very limits of its capacity and even beyond. It has done more than any other computer in human history and it did so on the leanest possible diet of memory and processing capacity. It had no margin for error and no room for bloat.
The Apollo Guidance Computer was probably the leanest, most efficient computer human beings have ever built, and it not only got humanity to the moon and back, but it also forced the human beings who worked on it to rise to the challenge along with it.
No other computer in history can say the same, and so it's about time we all showed it the respect it deserves.
There are going to be plenty of crazy costumes at that mega party this Halloween, but what about some cocktails to brighten the fun?