Block I Apollo Guidance Computer (AGC) : How To Build One in Your Basement
Block I Apollo Guidance Computer (AGC) : How To Build One in Your Basement
John Pultorak
December, 2004
Abstract
This report describes my successful project to build a working reproduction of the 1964
prototype for the Block I Apollo Guidance Computer. The AGC is the flight computer for the
Ap ollo m oon lan din gs, and is the wo rld’s first in tegra ted c ircuit com pu ter.
If you like, you can build one too. It will take you less time, and yours will be better than
mine.
Part 3 PROC M odule: Design and construction of the processing (CPU) modu le.
Part 4 MEM Module: Design and construction of the mem ory module.
Part 6 Assem bler: A cross-a ssem bler for AG C softw are dev elopm ent.
Part 7 C+ + S imu lator: A low-level simulator that runs assemb led AGC code.
Part 9 Test & Che ckou t: A suite of test programs in AG C assembly langu age.
Overview
The Memory Module (MEM) has 5 subsystems: MMI, ADR, EMM/FMM, MBF, and PAR
The AG C tra nsfers da ta to a nd from m em ory th roug h th e G re giste r during the "m em ory
cycle." The memory cycle takes 12 timing pulses (11.72 microseconds). During AGC
operation, data w ords cycle continuo usly from m em ory to the G register and the n back
again to memory.
There are four locations in eraseable memory, at addresses 20-23 (octal), dubbed "editing
location s" beca use w hate ver wa s stored th ere wo uld em erge sh ifted or rotated by on e bit
position. This shifting is performed in the MBF.
The 14 th bit in the G register (and the central registers in the AGC) is called the Uncorrected
Sign (U S). This extra sign bit is used as an overflow in dication in m ulti-word op erations.
Normally, the Sign and Un corrected sign should agree. When overflow or underflow
conditions occur, both signs will disagree, and are reconciled by software in an operation at
the end of a lon g string of mu lti-word com putations.
At the end of the memory cycle, the G register is copied back to memory. The sign bit in G
(bit 15 ) is written to the sig n bit (b it 14) in me m ory. Bits 13 throug h 1 in G are w ritten to
bits 13 through 1 in memory. A new odd parity bit is computed in the PAR subsystem and
written to the 16 th bit in mem ory.
T hese d ia gra m s
show the timing
of the m em ory
cycle. The top
chart is a little
m ore
conceptual; the
bottom cha rt
show s the clock
cycles and
control pulses
directly
associa ted w ith
reading
erasea ble
m em ory
(SBEW G) or
fixed m em ory
(SBFWG) to the
G register (the
‘WG ’ part
m ean s ‘write to
G ’) . T he WE
pulse w rites G
back to memory.
AGC/MANUAL Permits memory to be examined and loaded when the switch is in the
MANUAL position and the AGC is halted.
EXAM Loads the address counter with the contents of the switch register. To
work, the following switches m ust also be set: AG C/M ANU AL -->
MANUAL
NEXT Steps the address to the next location. To work, the following switches
must also be set: AGC/MANUAL --> MANUAL
READ/WR ITE Displays m em ory contents in the R EAD position; displays sw itch
register contents in the WRITE position.
LOAD Load memory with data manually entered into the switch register. To
work, the following switches must also be set prior to LOAD: CLOCK
CON TRO L (on CTL m odule) --> STEP; A GC/M ANU AL --> M ANU AL;
READ/WR ITE --> WRITE
CLEAR PARITY Clears a parity alarm indication by resetting the parity alarm (PALM)
register. The parity alarm indicator is on the IO modu le.
MEM CONTROL SWITCH CONNECTIONS
Each A GC instru ction has a 12 -bit a dd ress fiel d. Th e low er bits (1-1 0) a dd ress m em ory
inside each bank. Bits 11 and 12 select the bank:
00: selects the erasable memory bank; the BANK register is ignored.
01: selects th e low est ban k (ba nk 1 ) of fixed m em ory; the BAN K reg ister is
ignored.
10: selects th e nex t ban k (ba nk 2 ) of fixed m em ory; the BAN K reg ister is
ignored.
11: selects the BANK register, which is used to address any bank above 2.
If the BA NK register con tains 0 , 1, or 2, the B AN K reg ister is
overridden and bank 3 is selected.
Banks 1 and 2 are called "fixed-fixed" mem ory, because they are always available,
regardless of the contents of the BANK register. Banks 3 and above are called
"fixed -sw itchable" becau se th e sele cted ban k is determ ined by the B AN K reg ister.
Type:
E Eraseab le M em ory
FF Fixe d-F ixed Me m ory
FS Fixe d-S wit cha ble M em ory
S R egis ter:
14-b it BANK bits 12-b it
address bank type Reg. 12,11 address
00000 - 01777 0 (E) ignored 00 0000 - 1777
02000 - 03777 1 (FF) ignored 01 2000 - 3777
04000 - 05777 2 (FF) ignored 10 4000 - 5777
06000 - 07777 3 (FS) 0000 - 0011 11 6000 - 7777
10000 - 11777 4 (FS) 0100 11 6000 - 7777
12000 - 13777 5 (FS) 0101 11 6000 - 7777
14000 - 15777 6 (FS) 0110 11 6000 - 7777
16000 - 17777 7 (FS) 0111 11 6000 - 7777
20000 - 21777 8 (FS) 1000 11 6000 - 7777
22000 - 23777 9 (FS) 1001 11 6000 - 7777
24000 - 25777 10 (FS) 1010 11 6000 - 7777
26000 - 27777 11 (FS) 1011 11 6000 - 7777
30000 - 31777 12 (FS) 1100 11 6000 - 7777
0 0 0 0 1 1 0 0 1 1
0 0 0 1 1 1 0 0 1 1
0 0 1 0 1 1 0 0 1 1
0 0 1 1 1 1 0 0 1 1
0 1 0 0 1 1 0 1 0 0
0 1 0 1 1 1 0 1 0 1
0 1 1 0 1 1 0 1 1 0
0 1 1 1 1 1 0 1 1 1
1 0 0 0 1 1 1 0 0 0
1 0 0 1 1 1 1 0 0 1
1 0 1 0 1 1 1 0 1 0
1 0 1 1 1 1 1 0 1 1
1 1 0 0 1 1 1 1 0 0
1 1 0 1 1 1 1 1 0 1
1 1 1 0 1 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1
X= don ’t care
ADR OUTPUTS:
various:
EQU_16 ADDRESS = 016 0=CADR in reg S = 016
EQU_17 ADDRESS = 017 0=CADR in reg S = 017
GTR_17 ADDRESS > 017 0=CADR in reg S > 017
EQU_25 ADDRESS = 025 0=CADR in reg S = 025
GTR_27 ADDRESS > 027 0=CADR in reg S > 027
GTR_1777 ADDRESS > 01777 0=CADR in reg S > 01777
RBUS:
RB_01 READ BUS 01
...
RB_16 READ BUS 16
CPM:
WE WR ITE ERASEABLE 0= write m em ory bu s to
erase able m em ory
S BW G WRITE G (MEM) 0=read eraseable or fixed
memory onto memory bus
BIDIRECTIONAL (IN/OUT):
The following
section shows how
bits are sh ifted in
bus-to-register-to-
m em ory tra nsfers.
The row of 16
comm a-separated
entries rep resent b it
locations at the
destin ation ; the leftm ost entry is the M SB , and th e rightm ost is the LS B. Th e desig natio n in
each location identifies source bit location. This will become clearer shortly.
In memory, the 16 th bit is the odd parity bit, and the 15th bit is th e sig n. In th e G re giste r,
the bits are flipped: the 16 th bit is the sign, and the 15 th bit is the parity. The WE pulse,
which writes from the G register to memory, causes the sign bit (SG; bit 16 in G) to be
written to bit 15 in m em ory. Parity is written to mem ory from the pa rity generator (PAR ),
not from the p arity bit in G. (T he G parity bit holds th e pa rity rea d from m em ory.)
WE:
BX, SG, B14, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2, B1
Data is written from m em ory to G b y the S BW G con trol pulse . The sig n in m em ory (SG ; bit
15) is written to bit 16 in G. The parity bit (bit 16 in memory) is written to bit 15 in G by the
P AR su bsy stem .
SBWG:
SG, BX, B14, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2, B1
Data is written into G from the WRITE bus using WG (no shift), or one of the following
control pulses that prod uce the followin g shifts:
W20:
B1, BX, SG, B14, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2
W21:
SG, BX, SG, B14, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2
W22:
B14, BX, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2, B1, SG
W23:
SG, BX, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2, B1, SG
Data is read from G to the READ bus as follows. The parity bit (bit 15 in G) is not transferred
to the read bu s; instead, the sign b it is copied onto bits 15 an d 16 of the R EAD bus.
RG:
SG, SG, B14, B13,
B12, B11, B10, B9, B8,
B7, B6, B5, B4, B3, B2, B1
CPM:
RG READ G 0=output G register to read/write bus
WE WR ITE ERASEABLE 0=output G register to memory bus
GTR_17 ADDRESS > 017 0=CADR in register S > 017
WBUS:
WB_01 WRITE BUS 01
...
WB_14 WRITE BUS 14
WB_15 WRITE BUS 15 US (overflow ) bit for write
bus
WB_16 WRITE BUS 16 SG (sign) bit for write bus
MBF OUTPUTS:
CPM:
RG READ G15 0=w rite G15 into P
RP2 READ P2 0=write P2 into G15
ADR:
GTR_27 ADDRESS > 027 0=CADR in Register S evaluates to > 027
WBUS:
WB_01 WRITE BUS 01
...
WB_14 WRITE BUS 14
WB_15 WRITE BUS 15 US (overflow) bit for write bus
WB_16 WRITE BUS 16 SG (sign) bit for write bus
MON:
CLRPLM CLEAR PA RITY ALM 0= clea r parity ala rm
PAR OUTPUTS:
Module Rack
Solid copper wire (24 gauge) connects the boards to the bus bars. Ring terminals are used
on the bus bar side of the connection. On the circuit board size, the wires are soldered
directly to the supply rails.
Materials were purchased from Home Depot, ACE Hardware, and Radio Shack.
Circuit Boards
Pow er is di stribu ted o n th e ba ck-side o f each boa rd by bare 24-ga ug e solid copp er w ire
supply rails soldered at equal intervals to Klipwrap terminals: 3-prong terminals with a
squ are tail for w ire-wra ppin g (JA ME CO 341 63C L). A + 5V ra il runs a bove each row of soc kets
and a ground rail runs below. Each rail connects directly to the aluminum module power bus
usin g a rin g tail con nec tor.
On the p in sid e of th e bo ard, all con nec tion s are m ade w ith 3 0 A W G K yna r wire -w rap wire
(JAMECO ). Red wire is used for direct connections to the +5V supp ly rail. Black wire is used
for direct connections to ground. White wire is used for everything else.
Power connections from the supply rails to each ICs are double-wrapped. Bypassing
capacitors (.1 uf disc ) are soldered across the supply rails at the Klipwrap terminals; about
1 capacitor for every 2 IC packag es.
All connections were stripped and hand-wrapped using a Radio Shack hand-wrap tool. As
each connection was made, the corresponding line on the schematic was marked with a
colored h igh ligh ter.
DIP resistor networks (JAMECO) plugged into 20-pin wire-wrap sockets were used as current
limiting resistors for the panel ind icators.
MEM Printed Circuit Board (PCB) A
The A b oard contain s the zero-insertion force (ZIF) sockets for the fixed mem ory EPRO Ms,
and the 2 4 0-pin IDE con necto rs that in terface to the other m odu les. The e raseab le
me mo ries (U101 , U102 ) are also clearly visible next to the EPRO Ms. The M em ory Address
(AD R) an d Erase able/ Fixed Mem ory (EM M/F MM ) sub system s are prim arily loca ted on this
board.
MEM Printed Circuit Board (PCB) B
The B board contains the display indicators, their current-limiting resistor networks, and the
open collector drivers. The display panel is a sheet of white styrene plastic. A push pin was
used to make holes through the plastic and the LEDs were inserted in rows. The panel was
The C b oard prim arily contains the M em ory Buffer (MBF) a nd Parity Ge neration an d Test
(PAR ) subsystem s.
Parts (ICs)
74LS00 (11) U50,U25,U26,U27,U40,U32,U33,U34,U43,U44,U53
74LS02 (3) U52,U31,U55
74LS04 (12) U39,U28,U51,U56,U48,U46,U45,U41,U30,U35,U36,U54
74LS06 (21) U2 0,U 19 ,U1 8,U 15 ,U1 6,U 17 ,U1 4,U 13 ,U1 2,U 10 ,U1 1,U 9,U 6,U 7,U 8,U 5,U
4,U21,U22,U23,U24
74LS10 (3) U49,U37,U42
74LS20 (2) U47,U29
74LS27 (2) U2,U38
74LS74 (1) U1
74LS86 (1) U3
74LS154 (1) U72
74LS193 (4) U63,U64,U65,U66
74LS244 (31) U57,U58,U59,U60,U61,U62,U67,U68,U69,U70,U71,U73,U83,U84,U85,
U86,U87,U88,U89,U90,U91,U92,U93,U94,U95,U96,U97,U98,U103,U10
4,U105
74LS273 (10) U74,U75,U76,U79,U80,U81,U82,U106,U107,U108
74S280 (2) U77,U78
27C128 (2) U99,U100
2016 (2) U101,U102
Power Budget
qty mA (ea) m A (tot)
74LS00 11 2.4 26 .4
74LS02 3 2.4 7.2
74LS04 12 3.6 43 .2
74LS06 21 3.6 75 .6
74LS10 3 1.8 5.4
74LS20 2 1.2 2.4
74LS27 2 3.4 6.8
74LS74 1 4.0 4.0
74LS86 1 6.1 6.1
74LS154 1 6.2 6.2
74LS193 4 19 .0 76 .0
74LS244 31 32 .0 99 2.0
74LS273 10 17 .0 17 0.0
74LS280 2 16 .0 32 .0
27C128 2 25 .0 50 .0
2016 2 25 .0 50 .0
LED 124 20 .0 24 80 .0
-------
4.0 Amps total
1.6 Am ps (excludin g LEDs)