With all the buzz about the 40th anniversary of the Apollo 11 Moon landing I got to thinking, how powerful were the computers that “took us to the Moon?” It turns out, they were nothing short of amazing. If you’ve never had a nerdy bone in your body, feel free to skip this post. But, if you ever laid on your back under the stars and thought about Mercury, Gemini, Apollo or the Space Shuttle, read on and see if you’re as geek-struck as I was researching this.
My first thought was how did the Apollo computer compare to the iPhone? It turns out that’s a really tough comparison to make. The iPhone is so advanced compared to the computer used in Apollo’s guidance system that it’s hard to believe they both came from the same planet — at roughly the same period in time when viewed in contrast to man’s time line on Earth. To really make a comparison that makes much sense it’s much easier to look at the home computers of the late 1970’s and early 1980’s.
Take Intel’s venerable 8086 for example — you might know it better as “x86”. Released in 1979, just a decade after Apollo 11’s trip to the Moon, the 8086’s cousin, the 8088, formed the basis for the IBM PC we all know and love. When the IBM PC “XT” was released in 1981, the lowest end configuration had 8 times more memory than Apollo’s Guidance Computer — 16k, vs the Apollo’s 2k. The read-only storage of the AGC was 32k,
The IBM PC XT also ran at a dizzying clock speed of 4.077MHz. That’s 0.004077 GHz. The Apollo’s Guidance Computer was a snail-like 1.024 MHz in comparison, and it’s external signaling was half that — actually measured in Hz (1/1000th of 1 MHz, much as 1 MHz is 1/1000 of 1 GHz).
Internally, the 8086 had 8 16-bit registers available to work with — for those not familiar with the internals of a processor, a register is much like the numbers you’d keep in your head while doing math, and “memory” is more like scratch paper where you write things down for later use. The 8086 could keep track of 8 of those, the Apollo Guidance Computer held just 4. (The AGC also had a host of other non-general purpose registers, ranging from 1 to 16 bits in width, but it’s difficult to compare those with the architecture of the 8086)
Regardless, we’ve established that we’re dealing with some pretty archaic hardware. In many ways, the AGC was half the IBM PC XT you could buy off the shelf just a decade or so later. What’s so incredible about that? The part that blew me away when reading up on the Apollo Guidance Computer wasn’t so much the hardware, as the software they wrote to exploit it.
The real-time operating system in the Apollo 11 spacecraft could multi-task 8 jobs at a time, no small feat for the time it was developed, and something we take entirely for granted today. Multi-tasking however, wasn’t quite as we now think of it. Today’s operating systems use mostly preemptive-multitasking, where the operating system itself is in control of the execution and can stop any program at any time and hand off some computing power to another. The Apollo Guidance Computer relied on non-preemptive multi-tasking, whereby programs had to relinquish control back to the OS periodically.
The Apollo system also implemented a sophisticated virtual machine which offered more complex instructions, and could be used to perform more advanced mathematics. For it’s time, this was way-out stuff in 2k of memory and 32k of storage. The real-time OS managed transition between native instructions and the instruction set of the virtual machine, which let developers mix and match the hardware level instructions with the virtual instructions within the same assembler code. The complexity of those operations is simply mind boggling for someone who grew up writing in any high-level language such as BASIC, Pascal or even C.
Keep in mind that the Apollo 11 was actually the advanced “Block II” version of the AGC, and that earlier missions had relied upon as little as 24k of core read-only storage, and 1k of main memory, and you can begin to imagine the power the developers who wrote the AGC’s code must have felt.
Interface Design or What’s this button thingy do?
Every computer has some sort of interface, whether it’s just switches and blinking lights, or a complex GUI. The AGC was way closer to switches and blinking lights than you might imagine. Commands were entered in a combination of “verb noun pairs”, which would be input as numbers — translated into English on a painted sign in the spacecraft. When you listen to the tapes of the Apollo 11 landing, you can hear the Astronauts refer to nouns and verbs in talking with mission control back in Houston.
No computer would be complete without error messages, right? The AGC had those too, but when it flashed an error, it could easily mean you should kiss your ass goodbye and tell your loved-ones where you stored your last will and testament.
On the Apollo 11 mission for example, a crew mistake left one radar system on, while the landing crew used a second system to determine the distance to the ground. A “1201” error, and then a “1202” flashed causing enormous concern on the lander and back on Earth. The errors essentially meant the computer was taking in too much data to function, and left the crew in the lurch. It’s said that Neil Armstrong was paying little attention to the rangefinders when he finally set the lander down on the surface, 4 miles from its intended target.
Patches. We don’t need no stinking patches!
What would a good program be without upgrades? The crew of the Apollo 14 mission found out just how complicated their computer was when they were forced to patch the system code in-flight. A malfunctioning switch meant that the computer was receiving abort signals when no one was pushing the abort button! While orbiting the moon, NASA engineers devised an in-memory patch (all the systems code was stored in something we’d likely refer to as read-only memory. Unchangeable without physical upgrades) that the crew keyed in by hand. The error, patch authoring, and key-in was discovered, authored and programmed into the ship’s computer in about 90 minutes. Think about that the next time you wait months for a simple upgrade!
So, when you think about all those amazing manned missions to the Moon, and what it took to get there, don’t forget to ponder the blood, sweat and tears that went towards designing, building and programming the AGC. For the time, likely one of Man’s greatest achievements. As I read earlier — and can’t find a source to attribute now — one NASA engineer said later, had the complexities of the eventual AGC been understood when they began to design it, they likely never would have started, as they would have considered the computer far outside the available technology of the day.
Think this is geeky and esoteric? Try building an Apollo Guidance Computer in your basement.