From Wikipedia, the free encyclopedia
Jump to: navigation, search
Apollo Guidance Computer
Invented by MIT Instrumentation Laboratory
Manufacturer Raytheon
Introduced August 1966
Discontinued July 1975
Type Avionics
Guidance Computer
Processor Discrete IC RTL based
Frequency 2.048 MHz
Memory 16-bit wordlength,
2048 words RAM (magnetic core memory), 36,864 words ROM (core rope memory)
Ports DSKY, IMU, Hand Controller, Rendezvous Radar (CM), Landing Radar (LM), Telemetry Receiver, Engine Command, Reaction Control System
Power consumption 70W
Weight 70.1 lb (31.8 kg)
Dimensions 24x12.5x6.5 inches (61x32x17 cm)

The Apollo Guidance Computer (AGC) provided onboard computation and control for spacecraft guidance, navigation, and control of the Command Module (CM) and Lunar Module (LM) spacecraft of the Apollo program. It is notable for having been one of the first IC based computers.


The display and keyboard (DSKY) interface of the Apollo Guidance Computer mounted on the control panel of the Command Module, with the Flight Director Attitude Indicator (FDAI) above.
Partial list of numeric codes for verbs and nouns in the Apollo Guidance Computer. For a quick reference, they were printed on a side panel.

AGC in Apollo[edit]

Each flight to the Moon (with the exception of Apollo 8, which didn't take a Lunar Module on its lunar orbit mission) had two AGCs, one each in the Command Module and the Lunar Module. The AGC in the Command Module was at the center of that spacecraft's guidance & navigation system (G&C). The AGC in the Lunar Module ran its Primary Guidance, Navigation and Control System, called by the acronym PGNCS (pronounced pings).

Each lunar mission had two additional computers:


The AGC was designed at the MIT Instrumentation Laboratory under Charles Stark Draper, with hardware design led by Eldon C. Hall. [1] Early architectural work came from J.H. Laning Jr., Albert Hopkins, Ramon Alonso,[2] and Hugh Blair-Smith.[3] The actual flight hardware was fabricated by Raytheon, whose Herb Thaler[4] was also on the architectural team.

The Apollo flight computer was the first to use integrated circuits (ICs). While the Block I version used 4,100 ICs, each containing a single 3-input NOR gate, the later Block II version (used in the crewed flights) used dual 3-input nor gates in a flat-pack, approximately 5,600 gates in all. The gates were made by Fairchild Semiconductor using resistor-transistor logic (RTL). They were interconnected via wire wrap, in which the circuits are pushed into sockets having square posts, and wire is wrapped around the posts to form the connection. The edges of the posts press against the wire very firmly, forming gas-tight connections that can be more reliable than soldering. The wiring was then embedded in cast epoxy plastic. The decision to use a single IC design throughout the AGC avoided problems that plagued another early IC computer design, the Minuteman II guidance computer, which used a mix of diode-transistor logic (DTL) and diode logic (DL) gates made by Texas Instruments.

The computer had 2048 words of erasable magnetic core memory and 36 kilowords of read-only core rope memory. Both had cycle times of 11.72 micro-seconds. The memory word length was 16 bits: 15 bits of data and 1 odd-parity bit. The CPU-internal 16-bit word format was 14 bits of data, 1 overflow bit, and 1 sign bit (ones' complement representation).

DSKY user interface[edit]

Apollo computer DSKY user interface unit.
LM DSKY interface diagram.


The numerals were displayed via green high-voltage electroluminescent seven segment displays. The segments were driven by electromechanical relays, which limited the display update rate (Block II used faster silicon controlled rectifiers). Three 5-digit signed numbers could also be displayed in octal or decimal, and were typically used to display vectors such as space craft attitude or a required velocity change (delta-V). The data were displayed in American units rather than in International System of Units (although internal calculations were performed in metric units and then converted) This calculator-style interface[nb 1] was the first of its kind, the prototype for all similar digital control panel interfaces.

The Command Module had two DSKYs connected to its AGC; one located on the main instrument panel and a second located in the lower equipment bay near a sextant used for aligning the inertial guidance platform. The Lunar Module had a single DSKY for its AGC. A Flight Director Attitude Indicator (FDAI), controlled by the AGC, was located above the DSKY on the commander's console and on the LM.


The AGC timing reference came from a 2.048 MHz crystal clock. The clock was divided by two to produce a four-phase 1.024 MHz clock which the AGC used to perform internal operations. The 1.024 MHz clock was also divided by two to produce a 512 kHz signal called the master frequency; this signal was used to synchronize external Apollo spacecraft systems.

The master frequency was further divided through a scaler, first by five using a ring counter to produce a 102.4 kHz signal. This was then divided by two through 17 successive stages called F1 (51.2 kHz) through F17 (0.78125 Hz). The F10 stage (100 Hz) was fed back into the AGC to increment the real-time clock and other involuntary counters using Pinc (discussed below). The F17 stage was used to intermittently run the AGC when it was operating in the standby mode.

Central registers[edit]

The AGC had four 16-bit registers for general computational use, called the central registers:

A : The accumulator, for general computation
Z : The program counter - the address of the next instruction to be executed
Q : The remainder from the DV instruction, and the return address after TC instructions
LP : The lower product after MP instructions

There were also four locations in core memory, at addresses 20-23, dubbed editing locations because whatever was stored there would emerge shifted or rotated by one bit position, except for one that shifted right 7 bit positions, to extract one of the 7-bit interpretive op. codes that were packed 2 to a word. This was common to Block I and Block II AGCs.

Other registers[edit]

The AGC had additional registers that were used internally in the course of operation:

S : 12-bit memory address register, the lower portion of the memory address
Bank/Fbank : 4-bit ROM bank register, to select the 1 kiloword ROM bank when addressing in the fixed-switchable mode
Ebank : 3-bit RAM bank register, to select the 256-word RAM bank when addressing in the erasable-switchable mode
Sbank (super-bank) : 1-bit extension to Fbank, required because the last 4 kilowords of the 36-kiloword ROM was not reachable using Fbank alone
SQ : 4-bit sequence register; the current instruction
G : 16-bit memory buffer register, to hold data words moving to and from memory
X : The 'x' input to the adder (the adder was used to perform all 1's complement arithmetic) or the increment to the program counter (Z register)
Y : The other ('y') input to the adder
U : Not really a register, but the output of the adder (the 1's complement sum of the contents of registers X and Y)
B : General-purpose buffer register, also used to pre-fetch the next instruction. At the start of the next instruction, the upper bits of B (containing the next op. code) were copied to SQ, and the lower bits (the address) were copied to S.
C : Not a separate register, but the 1's complement of the B register
IN : Four 16-bit input registers
OUT : Five 16-bit output registers

Instruction set[edit]

The instruction format used 3 bits for opcode, and 12 bits for address. Block I had 11 instructions: TC, CCS, INDEX, XCH, CS, TS, AD, and MASK (basic), and SU, MP, and DV (extra). The first eight, called basic instructions, were directly accessed by the 3-bit op. code. The final three were denoted as extracode instructions because they were accessed by performing a special type of INDEX instruction (called EXTEND) immediately before the instruction.

The Block I AGC instructions consisted of the following:

TC (transfer control)
CCS (count, compare, and skip)
A complex conditional branch instruction. The A register was loaded with data retrieved from the address specified by the instruction. (Because the AGC uses ones' complement notation, there are two representations of zero. When all bits are set to zero, this is called plus zero. If all bits are set to one, this is called minus zero.) The diminished absolute value (DABS) of the data was then computed and stored in the A register. If the number was greater than zero, the DABS decrements the value by 1; if the number was negative, it is complemented before the decrement is applied—this is the absolute value. Diminished means "decremented but not below zero". Therefore, when the AGC performs the DABS function, positive numbers will head toward plus zero, and so will negative numbers but first revealing their negativity via the four-way skip below. The final step in CCS is a four-way skip, depending upon the data in register A before the DABS. If register A was greater than 0, CCS skips to the first instruction immediately after CCS. If register A contained plus zero, CCS skips to the second instruction after CCS. Less than zero causes a skip to the third instruction after CCS, and minus zero skips to the fourth instruction after CCS. The primary purpose of the count was to allow an ordinary loop, controlled by a positive counter, to end in a CCS and a TC to the beginning of the loop, equivalent to an IBM 360's BCT. The absolute value function was deemed important enough to be built into this instruction; when used for only this purpose, the sequence after the CCS was TC *+2, TC *+2, AD ONE. A curious side effect was the creation and use of CCS-holes when the value being tested was known to be never positive, which occurred more often than one might suppose. That left two whole words unoccupied, and a special committee was responsible for assigning data constants to these holes.
XCH (exchange)
CS (clear and subtract)
TS (transfer to storage)
AD (add)
Perform a bit-wise (boolean) and of memory with register A and store the result in register A.
MP (multiply)
DV (divide)
SU (subtract)




Apollo AGC 1024 bit memory module (front and back).

Block I AGC memory was organized into 1 kiloword banks. The lowest bank (bank 0) was erasable memory (RAM). All banks above bank 0 were fixed memory (ROM). Each AGC instruction had a 12-bit address field. The lower bits (1-10) addressed the memory inside each bank. Bits 11 and 12 selected the bank: 00 selected the erasable memory bank; 01 selected the lowest bank (bank 1) of fixed memory; 10 selected the next one (bank 2); and 11 selected the Bank register that could be used to select any bank above 2. Banks 1 and 2 were called fixed-fixed memory, because they were always available, regardless of the contents of the Bank register. Banks 3 and above were called fixed-switchable because the selected bank was determined by the bank register.

The Block I AGC initially had 12 kilowords of fixed memory, but this was later increased to 24 kilowords. Block II had 32 kilowords of fixed memory and 4 kilowords of erasable memory.



The lower 15 bits of each memory word held AGC instructions or data. Each word protected by a 16th odd parity bit. This bit was set to 1 or 0 by a parity generator circuit so a count of the 1s in each memory word would always produce an odd number. A parity checking circuit tested the parity bit during each memory cycle; if the bit didn't match the expected value, the memory word was assumed to be corrupted and a parity alarm panel light was illuminated.

Interrupts and involuntary counters[edit]

The AGC had five vectored interrupts:

  • Dsrupt was triggered at regular intervals to update the user display (DSKY).
  • Erupt was generated by various hardware failures or alarms.
  • Keyrupt signaled a key press from the user's keyboard.
  • T3Rrupt was generated at regular intervals from a hardware timer to update the AGC's real-time clock.
  • Uprupt was generated each time a 16-bit word of uplink data was loaded into the AGC.


The AGC also had 20 involuntary counters. These were memory locations which functioned as up/down counters, or shift registers. The counters would increment, decrement, or shift in response to internal inputs. The increment (Pinc), decrement (Minc), or shift (Shinc) was handled by one subsequence of microinstructions inserted between any two regular instructions.

Interrupts could be triggered when the counters overflowed. The T3rupt and Dsrupt interrupts were produced when their counters, driven by a 100 Hz hardware clock, overflowed after executing many Pinc subsequences. The Uprupt interrupt was triggered after its counter, executing the Shinc subsequence, had shifted 16 bits of uplink data into the AGC.

Standby mode[edit]

The AGC had a power-saving mode controlled by a standby allowed switch. This mode turned off the AGC power, except for the 2.048 MHz clock and the scaler. The F17 signal from the scaler turned the AGC power and the AGC back on at 1.28 second intervals. In this mode, the AGC performed essential functions, checked the standby allowed switch, and, if still enabled, turned off the power and went back to sleep until the next F17 signal.

In the standby mode, the AGC slept most of the time; therefore it was not awake to perform the Pinc instruction needed to update the AGC's real time clock at 10 ms intervals. To compensate, one of the functions performed by the AGC each time it awoke in the standby mode was to update the real time clock by 1.28 seconds.


Data buses[edit]



Several registers could be read onto the read bus simultaneously. When this occurred, data from each register was inclusive-ored onto the bus. This inclusive-or feature was used to implement the Mask instruction, which was a logical and operation. Because the AGC had no native ability to do a logical and, but could do a logical or through the bus and could complement (invert) data through the C register, De Morgan's theorem was used to implement the equivalent of a logical and. This was accomplished by inverting both operands, performing a logical or through the bus, and then inverting the result.


When the design requirements for the AGC were defined, necessary software and programming techniques didn't exist so it had to be designed from scratch.

AGC software was written in AGC assembly language and stored on rope memory. There was a simple real-time operating system consisting of the Exec, a batch job-scheduling system that could run up to 8 'jobs' at a time using cooperative multi-tasking (each job had to periodically surrender control back to the Exec). There was also an interrupt-driven component called the Waitlist which could schedule multiple timer-driven 'tasks'. The tasks were short threads of execution which could reschedule themselves for re-execution on the Waitlist, or could kick off a longer operation by starting a 'job' with the Exec.

The Exec jobs were priority-based. The lowest priority job, called the dummy job, was always present. It did diagnostic checks and controlled a green computer activity light on the DSKY: If the dummy job was running, this meant the computer had nothing better to do, so the light was turned off. The dummy job exited if there was some higher priority job to be done and this was indicated by the computer activity light being illuminated.

The AGC also had a sophisticated software interpreter, developed by MIT, that implemented a virtual machine with more complex and capable pseudo-instructions than the native AGC. They were used for navigational computations where greater precision was required. Interpreted code, which featured double precision scalar and vector arithmetic, even an MXV (matrix × vector) instruction, could be mixed with native AGC code. While the execution time of the pseudo-instructions was increased (due to the need to interpret these instructions at runtime) the interpreter provided many more instructions than AGC natively supported and the memory requirements were much lower (memory capacity was very expensive at the time). The average pseudo-instruction required about 24 ms to execute. The assembler and version control system, named YUL for an early prototype Christmas Computer, enforced proper transitions between native and interpreted code.

A set of interrupt-driven user interface routines called Pinball provided keyboard and display services for the jobs and tasks running on the AGC. A rich set of user-accessible routines were provided to let the operator (astronaut) display the contents of various memory locations in octal or decimal in groups of 1, 2, or 3 registers at a time. Monitor routines were provided so the operator could initiate a task to periodically redisplay the contents of certain memory locations. Jobs could be initiated. The Pinball routines performed the (very rough) equivalent of the UNIX shell.

The Block II[edit]

A Block II version of the AGC was designed in 1966. It retained the basic Block I architecture, but increased erasable memory from 1 to 2 kilowords. Fixed memory was expanded from 24 to 36 kilowords. Instructions were expanded from 11 to 34 and I/O channels were implemented to replace the I/O registers on Block I. The Block II version is the one that actually flew to the moon. Block I was used during the unmanned Apollo 4 and 6 flights, and was onboard the ill-fated Apollo I.

The decision to expand the memory and instruction set for Block II, but to retain the Block I's restrictive 3-bit op. code and 12-bit address had interesting design consequences. Various tricks were employed to squeeze in additional instructions, such as having special memory addresses which, when referenced, would implement a certain function. For instance, an INDEX to address 25 triggered the RESUME instruction to return from an interrupt. Likewise, INDEX 17 performed an INHINT instruction (inhibit interrupts), while INDEX 16 reenabled them (RELINT). Other instructions were implemented by preceding them with a special version of INDEX called EXTEND which arithmetically modified the 3-bit op. code by employing the overflow bit to extend it. The address spaces were extended by employing the Bank (fixed) and Ebank (erasable) registers, so the only memory of either type that could be addressed at any given time was the current bank, plus the small amount of fixed-fixed memory and the erasable memory. In addition, the bank register could address a maximum of 32 kilowords, so an Sbank (super-bank) register was required to access the last 4 kilowords. All across-bank subroutine calls had to be initiated from fixed-fixed memory through special functions to restore the original bank during the return—essentially a system of far pointers.


PGNCS trouble[edit]


Happily for Apollo 11, the AGC software executed a fail-safe routine and shed its low-priority tasks. The critical inertial guidance tasks continued to operate reliably. The degree of overload was minimal because the software had been limited so as to leave very nearly 15% available spare time which, wholly by luck, nearly matched the 6400 bit/s pulse trains from the needless, rendezvous-radar induced Pincs, wasting exactly 15% of the AGC's time. On the instructions of Steve Bales and Jack Garman these errors were ignored and the landing proceeded successfully. For making the decision to continue, Bales received the US Medal of Freedom along with the three Apollo astronauts. [7]

The problem was caused by neither a programming error in the AGC nor by pilot error. It was a procedural (protocol) and simulation error. In the simulator, the astronauts had been trained to set the rendezvous radar switch to its auto position. However, there was no connection to a live radar in the simulator and the problem was never seen until the procedure was carried out on Apollo 11's lunar descent when the switch was connected to a real AGC, the landing radar began sending data and the onboard computer was suddenly and very unexpectedly tasked with processing data from two real radars.[8]

00404 error code[edit]

The computer's other error codes included error 00404, which was shorthand for "IMU orientation unknown". Since the Inertial Measurement Unit device literally told the craft where to go, this has been compared to the HTTP 404 not found or browser navigation error code used on the World Wide Web. However, the later familiar HTTP error code did not originate with the AGC.[9]

Applications outside Apollo[edit]

The AGC formed the basis of an experimental fly-by-wire (FBW) system installed into an F-8 Crusader to demonstrate the practicality of computer driven FBW. The AGC used in the first phase of the program was replaced with another machine in the second phase, and research done on the program led to the development of FBW systems for the Space Shuttle. The AGC also led, albeit indirectly, to the development of FBW for the generation of fighters that were being developed at the time.[10]

See also[edit]


  1. ^ The first advanced desktop calculators hit the market in roughly the same time frame, with scientific and then programmable pocket calculators appearing during the following decade. The first programmable handheld calculator, the HP-65, was tried on backup computations aboard the Apollo Command/Service Module in the Apollo-Soyuz Test Project in 1975.


  1. ^ Hall, Eldon C. (1996), Journey to the Moon: The History of the Apollo Guidance Computer, AIAA, ISBN 156347185X 
  2. ^ "Ramon Alonso's introduction", AGC History Project (Caltech archive, original site closed), MIT, July 27, 2001, retrieved 2009-08-30 
  3. ^ "Hugh Blair-Smith biography", AGC History Project (Caltech archive, original site closed), MIT, January, 2002, retrieved 2009-08-30  Check date values in: |date= (help)
  4. ^ "Herb Thaler introduction", AGC History Project (Caltech archive, original site closed), MIT, 14-September-2001, retrieved 2009-08-30  Check date values in: |date= (help)
  5. ^ Collins, Michael; Aldrin, Edwin (1975), Cortright, Edgar M., ed., "A Yellow Caution Light", "NASA SP-350, Apollo Expeditions to the Moon", Washington, DC: NASA, pp. "Chapter 11.4", ISBN 978-9997398277, retrieved 2009-08-30  More than one of |author= and |last= specified (help)
  6. ^ Adler, Peter (1998), Jones, Eric M., ed., "Apollo 11 Program Alarms", Apollo 11 Lunar Surface Journal, NASA, retrieved 2009-09-01 
  7. ^ Cortright, Edgar M., ed. (1975), "The Lunar Module Computer", Apollo 11 Lunar Surface Journal, NASA, retrieved 2010-02-04 
  8. ^ Martin, Fred H. (July, 1994), Jones, Eric M., ed., "Apollo 11 : 25 Years Later", Apollo 11 Lunar Surface Journal, NASA, retrieved 2009-09-01  Check date values in: |date= (help)
  9. ^ Garmon, Jay (3 April 2007), "Geek Trivia: 404-letter Words", Tech Republic 
  10. ^ Tomayko, James E. (2000), "NASA SP-2000-4224 — Computers Take Flight: A History of NASA's Pioneering Digital Fly-By-Wire Project" (PDF), The NASA History Series, Washington, D.C.: NASA, retrieved 2009-09-01 

External links[edit]

Documentation on the AGC and its development[edit]

Documentation of AGC hardware design, and particularly the use of the new integrated circuits in place of transistors[edit]

Documentation of AGC software operation[edit]

  • Source code for Command Module code (Comanche054) and Lunar Module code (Luminary099) as text.

Some AGC-based technology history projects[edit]

  • Eagle Lander 3D Shareware Lunar Lander Simulator with a working AGC and DSKY (Windows only)

XXXCategory:Avionics computers XXXCategory:Apollo program XXXCategory:Early computers