YTread Logo
YTread Logo

34C3 - The Ultimate Apollo Guidance Computer Talk

Jun 08, 2021
The following

talk

is about a very relevant technological legend: let's see the first

computer

from our human race that landed on our moon and actually became a metric. People began to compare other architectures with other

computer

s in volumes of multiples of processing speed. of this computer is rocket science, but it's even more difficult, it's rocket science, so I'm very happy to have this gentleman or Hesse on stage, who is actually a rocket scientist, and for the computer part we have the style Mukesh, who is the founder of the xbox Dino project and has met with this project and many others, much, much experience around computer architectures, so please give a warm round of applause for Apollo's

ultimate

guide

talk

, welcome this to anyone here.
34c3   the ultimate apollo guidance computer talk
Yes, welcome to Apollo's

ultimate

guidance

computer. talk also known as a comprehensive introduction to computer architecture, operating systems, and spaceflight. My name is Michele Style and I'm Kristen Haseman. This talk is number six in a series by several people. The idea is to explain as much as possible about a classic computer system. 60 minutes the Apollo Guidance Computer AGC is a digital computer that was designed from the ground up specifically for use aboard the Apollo spacecraft to support the Apollo moon landings between 1969 and 1972 developed at MIT between 1961 and 1966 a total of 42 agencies in a costs about $200,000 each the base clock is about one megahertz all the data is 15 bits and there are two kilowatts of RAM and thirty-six kilowatts of ROM who avoids a ROM is about the size of one large suitcase weighs 32 kilograms and consumes about 55 watts.
34c3   the ultimate apollo guidance computer talk

More Interesting Facts About,

34c3 the ultimate apollo guidance computer talk...

The user's face is a numerical display and a keyboard. A historical context in the mid-1960s. You can simply take a commercially available computer and put it on a spaceship. The first minicomputers were the size of a small refrigerator, too heavy to consume much power. too slow for real-time scientific calculations even though the industry had come a long way since the previous decade, already 10 years later, although microcomputers with highly integrated circuits began to surpass HSC hardware in many aspects, there are many reasons that make them the HEC architecture is especially interesting. It's very 60's and seems very strange to us today the hardware is very innovative for its time it has some very interesting and unusual peripherals its operating system was revolutionary for its time and the mission says that the software has all the bits with the suitable hardware connected take you to the moon in the Apollo program, the Apollo

guidance

computer was used in two unmanned test missions where remote control goes from the ground in three man test missions and in the seventh manned landing mission the Astronauts hated the idea of ​​handing over any control to a computer they wanted to be in charge of, and while, as an alternative, most of the mission could also be done manually, the mission planners had their way in understanding the purpose. and the responsibilities of the Apollo guidance computer, we must first look at the core of the Apollo mission.
34c3   the ultimate apollo guidance computer talk
The Apollo program's strategy was instead to land the entire spacecraft on the moon, since an extremely large rocket would have been necessary only for Nanta, a much smaller lambda, while the larger part, with some for the path of Returning, remaining in orbit so that the Apollo spacecraft can be separated into lunar module, command module and service module, the Saturn 5 rocket launches him and three astronauts from Cape Kennedy into Earth orbit, accelerating at the right time the translunar injection with the spacecraft in the so-called free return orbit, but simply in inertia. would travel around the moon and return to earth right at the beginning of this three day journey the command and service module extracts the lunar module and docks with it braking on the opposite side of the moon the spacecraft enters lunar orbit after of two of the astronauts have climbed into the lunar module and after undocking the lunar module it breaks down, this is called powered descent and lands after resuming it, you know, the murderer is on the loose with the command and service module and the two astronauts of the lunar module board the lunar module.
34c3   the ultimate apollo guidance computer talk
The command module and lunar module are scrapped. The remaining command and service module accelerates on the far side of the Moon for the trajectory towards Earth to enter. Only the command module remains. By the way, these great visualizations are from Jared. I want videos of how the Apollo spacecraft works. which we can highly recommend, the command service module and the lunar module each contained a GC, it was the same hardware but connected to partially different I/O devices and with software adapted for the specific spacecraft, the astronauts interact with them through the screen and The keyboard units next to it need hundreds of switches.
The responsibilities of the computers during the mission are to track the position and accelerate the so-called state vector of the subsequent spacecraft. Stabilize the attitude of the spacecraft. Calculate a control engine burnout and monitor or control the Saturn V during launch. To understand how the Apollo Guidance Computer does all this, we will look at its architecture, hardware implementation, some of its interesting peripherals, system software, as well as system software and mission software, the architecture of the AGC can can be described as a normal accumulator machine with big-endian arithmetic in complement to a 15-bit one, so we will talk about the instruction set, the arithmetic model and instruction coding, as well as the io operations and counters of the memory model and Finally, interrupt model machine code instruction sets vary widely.
The instruction set of a modern ARM processor that is primarily optimized for on-time performance consists of approximately 400 instructions. Sublag is a language primarily of academic interest that shows that a single instruction can be sufficient to solve the same problems as all other Turing complete ones. While there are more complex builds that can achieve higher content density and contribute to higher performance, it also generally means that the CPU will be drastically more complex. A computer from the early 1960s consisted of only a few thousand transistors compared to billions today. that's why this is the sweet spot for HEC 36 instructions which provide roughly the performance that was required for the mission these are the 36 instructions some load and store instructions arithmetic and logic control flow instructions IO instructions and instructions to deal with with memory interrupts The model is the cornerstone of the instruction set.
The memory consists of 4096 cells numbered in hexadecimal from 0 0 0 to ffff. Each cell contains a 15-bit word number between 0 and 7 F F F almost all data changes: in memory pass through the 15-bit accumulator. It is also called registration. A program can copy words between the accumulator and a memory cell, but also add, subtract, multiply, and divide values ​​as they move. Data in memory can have many meanings depending on how it is interpreted. These values ​​can represent whole numbers. while those three words are intended to be decoded as machine code instructions, code and data in a single address space, they make the GCS occult machine, CPA program counter PC always contain the address of the instruction which will be executed next, the load statement copies the content. of a given memory cell in the accumulator, the PC moves to the next instruction, the add instruction adds the contents of a given memory cell to the accumulator, and the store instruction copies the value in the accumulator into memory at a given location , the generalized version of these instructions we just looked at use K as a placeholder for a memory address as an argument.
These are cards that are quick reference instructions. This is the generic syntax of the statement. A brief description of the exact operations in pseudocode. This takes a memory address k and adds it. to the accumulator with the coding of the instruction in memory and the number of clock cycles. The original syntax is the name the original designers gave to the instruction for this talk. I've chosen a more modern syntax here on the right, which makes it much easier, much easier to describe the CPU for people with and without machine programming experience, let's look at the instruction set in detail here's a example of the load statement, load an indirect comma to zero leading zero, you will see the set of agency registers, most of the operations work with the accumulator, so we will ignore the other registers for now while we execute this instruction, the CPU looks at the memory at location two zero zero, reads its contents, and copies it to the accumulator.
This is the instruction store. an indirect load to zero zero comma a like with all the instructions the first argument is the destination memory the second the source the accumulator appears directed to zero zero in memory and copies the contents of the accumulator to that cell there is also an instruction swap which can atomically swap the contents of the accumulator and a memory cell, the addition instruction will look up the contents of a given memory address and add it to the contents of the accumulator and store the result back into the accumulator and there is a subtraction instruction which takes the The content of the memory is subtracted from the content of the accumulator and stores the result back into the accumulator.
The result of each subtraction can be negative, so we need to talk about how negative numbers are expressed in AGC. Let's just look at 4 bits. numbers Unsigned integers untied from 4 bits can express values ​​from 0 to 15 with silent value encoding, the top bit corresponds to the sign and the remaining 3 bits represent the absolute value, therefore there are separate values ​​for more 0 and minus 0, but this encoding is difficult. to work, since 0 transitions need a special conversion once the complement encoding has the order of negative numbers reversed, 0 transitions are simpler now, but there are still two representations of 0, modern complement encoding only has a unique encoding for 0, it's completely backwards. compatible with unsigned addition and subtraction in the 1960s, computers designed for scientific calculations are generally one-time complement and so is the AGC in time for large numbers can express values ​​from 0 to 15 at a time complement the values ​​of 0 al 7 matches the unsigned values ​​zero through 7 and the negative size side is organized like this, unlike 2's complement, the two sides are perfectly symmetrical, so negating a number is as easy as complementing it, i.e. , invert all bits so that the two representations of 0 plus 0 with all 0 bits and minus 0 with the sum of 1 bits in positive space is equivalent to the same unsigned version in negative space when mapping negative numbers to signed through their unsigned counterparts, it becomes interesting when we have a signed 0 transition of 6 minus 4 is 6 plus minus 4, which is unsigned 6 plus 11, which in modulo 16 is 1, we have a carry once complementary, it is necessary to add a carry to the final result to arrive at the correct trick to jump over the duplicate transition 0 and 0 by adding the carries. called the end around K an overflow means that the signed result does not fit in the signed numeric space 7 plus 1 would result in minus 7 signed, which is incorrect.
The same thing happens when negative numbers are exceeded after applying the extreme and the result of the sign is taken. 7 here is incorrect, the CPU detects it and marks the result. The accumulator has an extra bit to record information about an overflow. We call it V, so if we have code that reads the value of 7 f F F from memory and adds 1, the result is. 0 and an overflow is detected, so the accumulator is checked, the store instruction in addition to writing 8 to memory does additional work if there is an overflow condition, clears the overflow condition, writes plus 1 or minus 1 to depending on whether it is positive or negative overflow and skips the next instruction this way the program can detect the overflow and use plus 1 or minus 1 to apply signed carry to a higher order word when storing a in memory, now we have a double word result in the negation of the one's complement. a number is as easy as flipping each bit of a word, so there is a dedicated instruction to load and negate a value.
LDC, which stands for load complement, reads from memory and denies itinverting all the bits and writes it to the accumulator incrementing, ie. Adding 1 to a word is such a common operation that there is a dedicated instruction that increments a word in memory, instead there is no corresponding decrement instruction instead two similar instructions increment and decrement the increment instruction adds one to the word. original value the increment instruction adds one to all positive values ​​and subtracts 1 from all negative values ​​increment effectively increases the absolute value while retaining the sign the dimension structure decrements positive values ​​in increments negative values ​​optimized for scientific calculations the CPU has circuitry dedicated multiplication model instruction reads a word from memory and multiplies it with the accumulator when you multiply two signs 15-bit words you need up to 29 bits i.e. two words for the result the entire result will be written in two registers the upper half in a and - be is a separate 15-bit register that is primarily used in conjunction with the accumulator with instructions dealing with 30-bit data.
Double word values ​​are expressed with the upper bits in a Morphin memory at lower addresses and the lower bits in B or higher addresses, making the EGC big endian. the machine assumes the normalized form with matching signs the effective value is the concatenation of the two times 14 bits of the division of values ​​it also works with double words it takes the combination of registers a and B as a dividend and a word from memory as a divisor as well there are two results: the result and the rest, the result is written in a and the rest in some other instructions that also allow using a and B as double word register. load a becomes indirect.a 0 0 searches directed to zeros or in memory and reads the words in the next cell in a and B the load complement variant does the same but inverts all bits during loading there are no instructions to store a and B in a single step but there is a double word swap instruction and finally there is an add instruction that works on double words and to load and store only register B there is an additional swap instruction for that, to work with tables , there is the indexed addressing mode, an instruction that takes an address as an argument can be used in this example load a comma indirect 7 0 0 + indirect 8 - 0 first looks up the address 0 8 0 adds it to the base of 7 0 0 which results in 7 0 2 read from that address and write the result to a What does this mean?
There is a table in memory at 7 0 0 in the example, it contains multiples of 3 and an index of that table is stored in memory at 0 8 0 with an example it is 2, so we have read the entry at index 2 from the table which is 6 without a base address we get the syntax in this example load a double comma indirect 8 0 the base is effectively zero in this case the CPU will look for the value in 0 8 0 in memory add to the base of 0, for so the value remains the same and is read from that address; In this case, the memory at zero eight zero effectively stores what we see now as a pointer and three series I of the pointers with different destination, the instruction carried out in the directory by the default instructions are executed sequentially the program counter kisi increases as instructions are executed always pointing to the next instruction control flow instructions like jump and conditional jump change that when the CPU executes a jump instruction it will load its argument into the program counter meaning execution will continue at that address jz jumped zero only jumps if a is su otherwise continue to next instruction similarly JL easy only jumps if a is negative or zero CCS count is compared and jumping is fun, it's a four way branch for execution depending depending on whether the value in memory is positive negative plus minus plus zero minus zero, it will jump to one of the next four instructions.
If you know the value is positive or zero you can ignore the other two cases and just fill the first two slots and if it is supposed to be just negative you should skip the first two slots, they should never be reached but it is good practice that the fill with error handlers, since ccs also places the absolute dimension value of the memory location in a, so it decrements a. The special case of ccs a can be used for loops that count down and the calling statement is not for calling subroutines aka functions, it is like a jump statement but saves its origin so you can return to it later for the program call instruction.
The counter is incremented first and then copied to the link register LR. Finally, the argument of the calling statement is copied to the program counter so that execution continues there. The link register now contains the return address at the end of the subroutine. The RET instruction effectively copies the contents of the liquor register into the program counter so that execution resumes right after the calling instruction. If the subroutine wants to call its own subroutine, the program has to save the binding record for ins to restore later. There is a specific exchange instruction for this for additional levels. a stack can be built manually using indexing syntax so far we have seen the following registers register a is used for memory accesses and all arithmetic is combined with a register b to duplicate with arithmetic the program counter to keep track of what is executed and the link register remembers the return address when calling a subroutine.
We haven't seen the zero register, but it always contains zero, so when we read it we get zero and when we write the value to it it starts it, there are three. More records we'll talk about later. The eight registers are numbered, that is, they have assigned memory addresses. This means that the first eight words in memory are actually occupied by registers. They can be accessed using addresses and all instructions that take a memory address. allows much greater flexibility in the instruction set, we can load a with the contents of register B by reading the contents of memory at location one in a, the zero console can be loaded into a simply by reading from memory in seven, which is the Zero register a can be incremented by incrementing the memory by a zero Edward and B can be used as a pointer reading from a double indirect.
Let's look at memory more closely. The memory has 4096 words and goes from zero zero zero two ffff, the registers are located in At the bottom of the memory, including them, there are one thousand 24 words of random access RAM and 3 kilos of read-only ROM memory. The agency was originally designed to have only this small RAM and ROM, but there is actually more, let's look at the RAM. area the top quarter is deposited the area is a window through which one of eight different banks can be accessed each 250 words in size the erasable bank record EB points to one of these banks if eb0 The zero of the bank is visible in bacteria if EB is five Bank five is the visible address, it is not the fixed area that always represents the same RAM cells, but these are not additional cells approximately equal to those in banks zero, one and two, This means that there are a total of 8 times 256 words of RAM per kilowatt that the ROM has. arranged similarly bottom killer word is folded fixed bank register FB selects one of the 32 banks support for over 32 kilo ROM words added at the last minute super bank bit can change the top eight banks to the second set so that The architecture supports a total of 40 keywords.
The fixed ROM area will always show the same content as two of the ROM banks. The designers chose banks two and three to simplify address coding. In practice, fixed ROM contains the core code of the operating system and fixed RAM. core data of the operating system that must be available at all times the remaining functionality is distributed between the different ramen banks. Changing the RAM bank can be done by writing through the EB register. This is not a separate instruction, but can be expressed by writing a memory location. three if a is five writing a to EB will make a Ram bank visible at three zero zero the same storage structure could be used to write to the FB register in the memory location that fakes the ROM bank but that wouldn't work for a common In case the code in one bank wants a call code in another bank, first change the ROM bank loading FB and then make the function call by writing the bank number in the FB, the bank in the one that is currently executing the code so that it will fail to execute the calling statement instead of continuing to execute some completely unrelated code that gets the same address in the other bank to call the code in a different bank.
The FB and PC registers must be changed atomically. Calling F is just a synonym for The existing double-word swap instruction code first has to load the bank and program counter in A and B, and then calling F can be atomically moved to FB and PC. The same swap instruction can be used for a far return; moves the original values ​​back to FB. and PC, the two bank registers only contain five and three bits respectively, the other bits are zero and there is a third bank register BB, both banks merging the information from the other bank registers, the call for both banks, the synonym is a double word swap instruction that updates the program counter and subroutines of both banks usually have their private variables in particular Ram banks, call for both banks to pass control to a function in the different ROM bank and also directly switch banks Ram so that the colleague can immediately access its variables return for both banks return For the caller to restore his RAM Bank settings, the unusual order of the bank records was chosen to allow an exchange of FB and PC doublewords, as well as an exchange of double words from PC and BB.
Now we have seen the eight registers if there are eight more special locations in memory above the register, the shadow area we will talk about later and above them are four edit registers that compensate for the missing shift and rotate instructions when writing a 15 bit value in the RoR I. was not recorded, it will move to the right, I was wondering, and the lowest bit will be one cycle up, the result can be read later. back role turns left sh r shifts to the right doubling the top bit and SHR seven shifts right by seven bits filling the top with zero, this is necessary for the software component of the interpreter system that we will learn later.
We have seen that the CPU is connected to the RAM and the ROM to the memory bus, but computers also communicate with peripheral devices which is the i/. On the bus we have already seen the address space for memory, there is a second space of addresses to talk to the devices, there are 512 IOH channels numbered from 0 0 0 to ffff, each channel has 15 bits and the input and output instructions can read words from and to the right. to I/O channels for many devices, one channel contains 15 individual control bits, the control bit can, for example, toggle the lamp on a display, the output or instruction sets individual bits and clears and clears individual bits to that the instructions can work throughout the word. o perform boolean operations on them and o and There are also dedicated instructions that run on and in memory after the shadow area registers and edit registers.
There is another special area that counts as I/O channels, they connect to external devices but do not send bits or held words back and forth, instead they are controlled by hardware pulses or cause hardware pulses. on each pulse, one is incremented, for example, while other counters take the number stored in them by code and count down generating pulses when the IO devices need to tell the CPU that it can interrupt normal execution next to the program counter that points to the next instruction, there is the instruction register that contains the current opcode when an interrupt occurs the safe copies PC is a special memory location PC Prime and I are in IR Prime and then we jump to a magic location depending on the type of interrupt in this example 8 1 4 when the interrupt occurs The handlers finished repairing the device, the instruction I read will copy the PC and an IR crying again on the PC and I am, so execution will continue in the original location.
The eight blue hexadecimal memory locations F are shadows of the eight PC registers and I are automatically saved by Interruptsand the remaining registers must be saved by software, if necessary, the overflow condition flag cannot be saved or restored, so as long as there is an overflow condition until the next save instruction that resolves the flush interrupts is disabled , the 11 interrupt handlers must reside in fixed locations. ROM starting at 8200 there are four words for each input the typical interrupt input code saves a and B loads a and B with a burst of and the actual controller PC and jumps there interrupts zero is special is the entry point on reset a next we will enter the interrupted spin instruction there is an instruction to cause an interrupt in the software and instructions to enable and disable interrupts globally there is one more special memory location in x-37 the watchdog from where this should be read, read or written location, at least every point six four seconds, otherwise the hardware will decide that the system software is not responding and will cause a reboot.
Now we have seen a set of instructions and in the examples we have seen the codes that represent instructions in memory. Let's see how encryption works on upload. instruction the top three bits are the opcode representing the load a and the remaining 12 bits encode the address, this allows for a total of eight instructions but there are more than eight instructions with DRAM address as it always starts with zero zero and the dramatic dresses start with anything but zero zero, so the store instruction that only makes sense in RAM only needs to encode 10 address bits instead of 12, leaving room for three other Ram-only instructions.
The same goes for the increment statement, which leaves room for three more, as well as CCS, which there are. a jump opcode that only works on Rama dresses, since jumps to the bank register don't make much sense. These codes are used to code STI CLI and extend extend is a prefix that changes the meaning of the opcode of the next instruction, allowing for a second set of two-word instructions, there is one more special instruction call to which calls LR, which is the return instruction, but the CPU does not have a special case. This return is a side effect of calling memory at location 2, executing the instruction. encoded in the LR register the 12-bit address with leading zeros is decoded into another call instruction that transfers control to the return address indexed addressing is achieved using the index prefix an indexed instruction consists of two words of index instruction and the base instruction the addressing code in the base instruction is the base address and the index instruction encodes the address of the index index is an actual instruction that the CPU reads from the given address 0 0 in the example then adds its value 3 to the instruction code of the next instruction 3 7 0 0 which is stored in the internal IR register, then uses the resulting instruction code 3 7 over 3 for the next instruction, which is a load from 7:03 the effective address if an interrupt occurs later in the index instruction, that is not a problem because IR contains the effective instruction code that will be saved in IR Prime and restored at the end of the interrupt handler.
Finally, there is an index encoding with a special meaning when the address appears to refer to the shadow instruction register, it is an interrupt return instruction that looks at the instructions that the architecture like. In general, there are many quirky and unusual features in comparison with modern architectures. Use one's complement instead of two's complement. It has no status record. The overflow flag can't even be saved, so interrupts are disabled until the overflow is resolved. The store instruction can skip a word in the circuit, under circumstances ccs destruction can skip multiple words and can be downright dangerous if the instructions that follow use prefixes, there are no shift or rotate instructions but magic memory locations that are moved and rotated by writing only most of the Boolean instructions to them.
The work on old channel indexing is done by hacking the following instruction code and the architecture has no concept of stack indexing. If necessary, one should be used. This was the architecture of the Apollo guidance computer. Now let's see how this architecture is implemented. In hardware, the hardware implementation runs at one megahertz, is microcoded, and uses integrated circuit core memory and transfer memory. We will look at the block diagram and how the instructions are implemented in microcode and then we will see how the schematics are mapped to the ICs in The inputs of the modules, this simplified body block diagram shows the AGC at the hardware level.
Each box contains on the order of 500 logic gates. The dashed lines indicate that to move a single bit of information, the solid lines are 15 wires that move one word of data. the units deal with timing and control and these are the central units the central register units store a link register B and a program counter and the arithmetic unit can add and subtract numbers the memory components deal with the RAM and ROM the main clock of approximately one megahertz is fed to the sequence generator which continues to cycle through twelve stages, which is one memory cycle.
MCT instructions generally take as many memory cycles as they need memory accesses, so load, add, and store takes two cycles and jump takes one. The sequence generator contains a collection of 12-step microprograms for each MCT for each instruction like this for the load instruction in each step the inputs send control pulses to the other units that are connected via the right bus the control signal waa, for example, tells the register unit to place the contents of a on the right side of the bus, and RA causes it to read the value on the bus into a memory that is also connected to the correct bus.
WS will copy the contents of the bus into the memory address register and RG+WG will read and write the g register which stores the cells value after reading. earlier on the right, in stage 7, for example, RG places the memory buffer on the bus and WB writes the contents of the bus to the temporary register g. net10 b is placed on the bus and read from register a at the beginning of each memory cycle. The hardware sends the memory address, usually the encoded instruction, to memory and copies the contents of that address to g in the second half of the MCT, it stores G again in the same cell, so if we use memory time together to the microcode, as well as the pseudocode version of the load instruction that is easy to read, we can see that it lost the memory value M in G, copies it to B and then copies it to a more interesting swap instruction, saves from a to b, reads the memory in g, copies the The result in a cop is the previous value in g and stores that g in the memory division, for example, it takes several MCTs and its microprogram is much more complex, but there are more microprograms than those in the machine instructions, since there is only one sum. unit throughout the computer, incrementing and decrementing the counters is done by converting the pulses into special instructions that are injected into the instruction stream.
There are 14 of these so-called sequences not programmed with our own firmware, some counter changes, some are interacting with debugging. hardware and these to control interrupts and interrupt and reset sequences the complete schematics are publicly available and fit on only 49 sheets the entire implementation only uses a single type of gate a three-input NAND gate two of them are contained in one circuit Integrated into about a hundred of these formal ICS logic modules, 24:00 logic modules and some interface and power supply modules are connected to each other on tray A, which also contains the I/O and debug connectors.
Tray B contains various controller amplifier modules as well as RAM and ROM. It is implemented as a magnetic core memory that stores bits and magnetized turrets that read a bit and erase it, so the memory sequencer makes sure to always write the value back after reading it without masters like tapes. The AGC has an unusually high number of full ROM encodings. bits using wires passing through or through a ferrite core, the 500,000 bits per computer were woven entirely by hand. Traces A and B are put together in this way and hermetically sealed to achieve a fairly compact computer, this is its orientation when installed on the spacecraft with the six ROM modules accessible, so in theory they could be replaced during the mission and that was the hardware part.
Next, let's look at the devices, look at the devices connected to the computer, we'll look at the quality of Isis that Dahlia programs to maintain. the state vector, some rather special devices not seen in many other computers and the peripherals used for communication with the astronauts and mission control, the gyroscope is the central peripheral upon which the guidance computer was originally built Apollo around the program computer, rotates it in a certain base position with the CDU command counters and then the gyroscope detects the rotation around the three axes of the spacecraft which can be read off the CDU counters using the gyroscope the spacecraft always knows its attitude, that is, its orientation in space, the accelerometer adjusts the acceleration forces in the three axis but forget that the three values ​​can be rented in the piper counters the optics in the command module which I used to measure position relative to celestial bodies the computer uses the opt command counters to move the optics to point towards the general direction of a star and will read the astronauts fine tuning via the orbit counters the radar The landing radar is located at the bottom of the lunar module and measures the distance to the ground.
The interruption involved in the radar will be activated each time a new measurement is available and the iron reading counter contains the lunar modules' rendezvous radar. new value measures the distance of the command and service module during the rendezvous after setting the two angles and the CDT and cgus counters to point it towards the state ship or other spacecraft, it will automatically track it and cause radar interruptions when there is new data. is available and can be read on the red iron counters, the command module, the service module and the lunar module, all contain a reaction control system RCS Jets that emit small bursts to maintain or charge attitude in the module mole.
There is one bit for each of the sixteen Jets. setting a bit to one will cause the jet to fire. The system software uses a dedicated six-hour timer and its interrupt t6 is wrapped to time the pulses. The user interface is provided by the so-called disk key which means screen and keyboard. It has 19 keys, 15 lamps and several numerical output lines. The keys generate the interrupts wrapped in the key and the number of the key can be read from the key in the I/O channel. The numerical display is driven by the external channel. There are p directional digital radio communication and an interval between Mission Control and each spacecraft and a selectable rate of 1.9 or 51 kilobits per second, Mission Control data words appear on the interior counter and trigger the sending of data words. inter and abrupt data that are stored in the I/O channel and do not interrupt thinking about the program when you can load the register with the next word these were some of the interesting peripherals the AGC system the HCC system software turns it into a computer fault tolerant real-time interactive preventative and priority-based cooperative with a virtual computer machine support the topics we will talk about are multitasking the interpreter device drivers and queuing as well as the user interface and backup mechanisms network for failover the AGC has a lot of things to do it does math calculations that can take several seconds and it does IO with its devices, its services are interrupted when a device wants the computer's attention, for example by pressing a key , performs regular maintenance on shutdown devices, such as refreshing the display, and supports real-time control, such as turning on a lamp or firing reinforcements at exactly the right time. only one CPU, so you have to switch between different tasks.
Batch multitasking computers work on long-running jobs one after another, but if some jobs have higher priorities, it makes more sense to run a job for only, say, 20 milliseconds and then check the job queues. and continue executing the highest priority job in the queue untilfinished and removed from the queue, then continue selecting the highest priority job. Jobs must manually check at least every 20 milliseconds to see if there is a higher priority job in the queue when doing so. -called performance, which turns the AGC into a priority-scheduled cooperative multitasking computer. A job is described by a 12-word data structure in the PC's memory, and both banks record the point where the job will begin or continue executing, as well as a word with a disabled flag in the sign bit and a priority of 5 bits, the main set consists of seven working inputs; are in the priority word, which means the entry is empty.
Job zero is always the one currently running when a new job with a higher speed is created. priority the performance operation will swap the 12 words so that the new job is job zero denying priority will put the job to sleep so that performance doesn't change it again denying it again will wake it up the first eight words in the job entry can be is used for local storage of the job, since it is always job zero that is executed. These words are always conveniently located at the same addresses in memory. The executive has a set of subroutines that control the data structures of the job.
You can create a new job pointed to by a pair of PC and BB registers of a given priority change the priority of the current job put the current job to sleep wake up a given job and terminate the current job performance of the current job is not an executive function but a sequence of two statements that checks the new variable job in which the executive always has the idea of ​​the highest priority job if job zero is the highest priority job there is nothing to do if there is a higher priority job calls the job change subroutine that switches to that job the new job is not only a variable in memory but also the watchword if it is a regular access that is cooperative multitasking stuck the hardware will automatically reset much of the code in the AGC makes scientific calculations by calculating, for example, just the sum of two products of a scale and a vector would require hundreds of instructions in a GC machine code.
There is library code that provides all kinds of operations on vectors and matrices of single, double, or triple precision fixed point values. It also provides a multipurpose software accumulator and a PAC that can hold the double triple or a vector e depending on the mode flag in c as pseudocode, we would load the vector into the impact multiplied by a scalar, save it, do the other multiplication and add the result to saved value formulas like this that need to store intermediate results, so a thirty-eight word stack is provided. If a job uses mathematical code, the impact of the mode field and the stack pointer will be stored in the remaining course fields upon entering, the stack will be part of a datastore, a structure called vac that will be pointed to by the course upon entering a job can be created with or without a vacuum depending on which subroutine is created with the code version example code would still be very verbose with many function calls passing pointers to the software designers AGC decided to create a new, compact language that will be interpreted at runtime a virtual machine the interpretive language is complete and in addition to the impact has two index registers two step registers and its own link register the coding manages to fit two seven-bit opcodes in one word allowing 128 opcodes and explains why there is a right shift in seven functions in the CPU.
The two operands are stored in the next two words. They are 14-bit addresses. 14-bit addresses mean interpretive goats. It is no longer necessary to work with this complicated memory layer, it allows approximately half of the ROM to be addressed at the same time in the lowest Killa word of each half. The RAM is visible so that interpretive code can choose between one of these two memory layouts. This is the complete set of instructions. Interpretive code from normal machine code can be mixed and matched within the job. The exit instruction will continue to execute normal machine code at the next address and the threat call will switch similarly to interpreter mode in addition to long-running math tasks.
The system software also supports the device. drivers when a device needs the attention of the computer, for example in case the e key of a disk is pressed, an interrupt occurs, the current job will be interrupted and the interrupt handler will read the data from the device and return as quickly as possible if there is more to do. schedule a job for later some devices need to be serviced regularly The 120 microsecond timer causes interrupts that read data and write the date correctly all data and write data on certain devices the e-disk numerical display, for example, only allows updating some few digits at a time time, so your controller is triggered by the 120 microsecond timer, the timer interrupt cycles through eight phases that distribute the device drivers over time to minimize the duration of an interrupt controller.
Some devices need to be activated at exact times if, for example, work decides it's necessary. To blink a lamp twice, you would turn it on immediately and schedule three weightless tasks on some in the future at specific times, the first will turn off the lamp, the second will turn it on again, and the third will turn it off again. The ordered time deltas of the Weightless tasks are stored in the LST one data structure with the first entry always counting down in a timer register and LST contains a pair of PC and BB for each task, there are subroutines to create a new task and terminate the current task on timer that controls the waitlist has a granularity of 10 milliseconds other timers can fire at the same rate but are offset and the job triggered by them is designed to be short enough to never overlap with the next potential job triggered by the waitlist. timer This is complicated by device interruptions that can appear at any time.
The duration of an interrupt handler causes latency and the maximum delay will reduce the time allowed for timer handlers. The core system software makes no guarantees about time, it all depends on the components. It is up to all components to cooperate so that the goal can be achieved in real time. The pinball program is the shell of the AGC. The interrupt scheduler's job is to collect the digits for the command and update an in-memory representation of what should be activated. the screen the 120 millisecond timer activates the screen refresh code when the pinball command is completed schedules a new job Mission Control has a remote shell in the form of a disk key connected through the s-band radio system the software that supports human life has to be able to communicate malfunctions and recover from them, the alarm subroutine takes the next word from the instruction stream, displays it, and illuminates the programming light.
This should be interpreted as a warning or error message. HTC's software is full of validity and plausibility checks that help. to find errors during development and helps better understand potential problems during the mission, some types of failures caused by various hardware monitoring devices or by code make it impossible for normal operations to continue, in addition to displaying the error code, also They cause a hardware reset, but the system software also offers recovery services. A job can have a recovery code for its different phases during execution, it sets the respective phase and if an interruption occurs in any job or task, the currently configured recovery routine is executed, which could for example clean up and try the work. again or jump to a different phase or cancel the job completely the phase change call sets the current phase for a job in the recovery table, for example phase 5 for the job for each phase is associated with a descriptor a task or a job with or without a vacuum, so during normal execution with multiple jobs and scheduled tasks, if an interrupt occurs, the core pool and waitlists are cleared, the table contents are activated recovery, tasks and jobs are scheduled for all jobs that configure the recovery code, sometimes it fails, even though it is corrupted. memory is not recoverable, they cause a fresh start which means a complete system initialization without running any recovery code and that was the AGC system software as we now have a good overview of the architecture, hardware peripherals and the polygon system software, it can be done, it's time.
It would be free, it is practical to use on a mission to the moon. We will watch the user enter, simulate the launch sequence and once in orbit, determine the attitude in orbit. Additionally, we will understand how the digital autopilot works and how powered flight is performed. as soon as we get to the moon we look at the lunar landing and the lunar rendezvous after take off and finally the re-entry into the earth's atmosphere last but not least contingency so as we like to call them fun topics let's get started with the user interface. like any command line interface, but since there are only numbers and no letters, the keywords must be encoded in a normal system, you could say show memory, enter this place, the word memory is the noun in the Apollo guidance computer, you say verb or 1, which means display the noun a in memory enter support Ino prompts for an argument in a normal system, it can display a prompt for you to enter the presenter number in the polygon computer which flashes the gun now and indicates that is waiting for input, so it types 2 5 enters an octal address and the program's Twitter displays the result the contents of memory at the octal address 2 5 the program's computer uses the same concept of a verb and noun when it proactively requests information input verb 6 9/11 requested ignition time CSI CSI means Co start of elliptical sequence Will arrive at Delta later, special cases where the program traveler asks a yes or no question.
Road 99 has the astronaut confirm engine ignition with a proceed key. Astronauts have a complete reference of all verbs and nouns on paper, as well as on cue cards. was the most important information, now let's go over each of the phases of the mission starting with a takeoff, so now we are Erway, the Apollo guidance computer is a passive monitoring mode with the cutting of the umbilical cables that you see right now , has started. the mission clock in cases where the trigger fails 1 this key is always ready with verb 75 and just waiting for it to come in to manually start the mission timer we can show the elapsed time of the mission at any time with the verb 16 noun 65 during flight with the Saturn 5 Apollo grants travelers only passive monitoring of the flight control of Saturn's fibers with its own launch vehicle digital computer and instrument unit rings the dial key automatically sixteen 962, which is the speed in feet per second, the change in altitude, the weight in feet per second and the top altitude. pet and nautical miles note that the units and decimal point position are implied and yes the whole system ran internally in metric but for the benefit of the American astronauts the display procedures converted everything to imperial units it's fine in In case of problems with the Saturn computer that the Apollo grants Buddha can take full control of the launch vehicle, in extreme cases, the astronauts could even direct the entire stack to orbit themselves with the manual controller in case any Maybe you would like to fly with the manual control of a 110 meter high rocket with more than 30 million Newtons of thrust this is your opportunity in less than 12 minutes we have gone through the first and second stages and use a small combustion of the third stage to take us to a 185 kilometer orbit that circles the Earth every 88 minutes but how do we know where we are in the correct orbit?
The Apollo guidance computer, as well as mission control and position and velocity monitoring, because to get to where we want to be, we must first know where we are in order to navigate in space. we need to maintain our three-dimensional position and there is three-dimensional velocity the so-called state vector let's startwith the determination of the position for this we need a telescope and a spatial sextant the spatial section is very similar to an 18th century in nautical The position of the sextant is determined by measuring the angle between the horizon and a celestial body. As a horizon we can take that of the Earth or the Moon and the celestial bodies, well, we are not, but we are surrounded by them, so let's choose one.
Luckily, the Apollo guidance computer already knows the position of 45 of them, all the optical hardware and lives in the command and service module can be moved to point in the general direction of Earth a moon with the launch of the 52 program We order the Apollo guidance computer to rotate the spacecraft to point one axis of the sextant the so-called reference line of sight ll OS to the nearest body which is the Earth or the Moon the astronaut then used the optical systems to exactly align the horizon with the ll OS with a telescope the astronaut looks for one of the known stars points the star line towards it and lets the Apollo guidance computer read that junction and the angle of the axis, repeating this one or more times in a different plane is obtains a three-dimensional position of the vehicle in space on the lunar module on the other hand.
On the one hand, the optics The hardware was trimmed to reduce weight, any alignment requires rotation of the lunar module. This is primarily used to determine the landing location and support the rendezvous maneuver. The software then does the positioning and translunar spacing as we move, our position changes everything. time, but after 2 location corrections, as long as we are moving forward, we can set our speed and we can determine future positions by that calculation, since the position and speed are now in future positions, they can be extrapolated, unfortunately, the extrapolation of knee doesn't work. In space, because we have gravitational forces deflecting our path, fortunately there are two mathematical models implemented in the Apollo guidance computer.
Chronic integration based on the capillary and orbital model on the left, which assumes a perfectly round gravitational body that influences our flight path and anchor integration method. for the perturbation considering multiple bodies with gravitational imbalances, I think this helps to understand why we need an onboard computer and consciously fly to the moon with the hand controller, as we see that the Apollo spacecraft was perfectly capable of flying on its own , but in the end NASA decided that the primary source for state vector updates or Mission Control in Houston measured with three ground stations remote programming is done with Apollo guidance to be down and running the program 27 Mission Control You can use your S-band link cable to update the vector state, but there is one thing that Mission Control doesn't know any better than we do and that is attitude: attitude is the orientation of the spacecraft in its three axes from a known attitude, we have to make sure that we can measure any rotation in any axis, that's what gyroscopes are. because they are one of the main components of the IMU, the inertial measurement unit, three gyroscopes, the WAMP axis measures any rotation and provides its data to the Apollo guidance computer to track the attitude of the spacecraft before it Let's leave Earth's orbit.
Let's quickly analyze the topic. Digital autopilot is the largest program on the Apollo guidance computer with approximately 10% of all source code in both the command and service module and the lunar module the implementations for each vehicle are significantly different although due to the different joint thruster flight modes and vehicle symmetry, since there is no friction in space, the smallest event would cause the spacecraft to constantly rotate the air's digital autopilot The Apollo guidance computer uses the Jets to maintain attitude within of certain thresholds, the so-called dead bands, in which the autopilot is also used. In case the astronauts ever need to use the manual controllers for the thrusters, basically, put the command service module and the lunar module has control fly-by-wire, since any faster one could break down at any moment, the autopilot is able to calculate the ideal combustion mode even with a reduced number of lists, it has some simple algorithms for the center of gravity and weight distribution , which are also taken into account when calculating maneuvers.
You can do more than that, even if you give it a new attitude and it will calculate the most efficient transfer vector to reach the goal. new attitude, certain flight modes may be required to have stable rotation, whether for temperature control, landing site monitoring or other reasons, the autopilot supports stable and constant roll that can be activated directly, the The autopilot not only controls the attitude, but also supports the crew in performing powered flight maneuvers, a potential solution is calculated, which can obviously be overwritten from the ground as usual, but still, after confirmation, the pilot Automatic automatically starts the motors and keeps a timer for the correct time; although not many measure the results of combustion.
For powered flight, dead reckoning is obviously no longer correct, so the Apollo guidance computer contains a subroutine called G-average that takes input from the IMU, i.e. gyroscope and accelerometer, to calculate the change in state vector now that we know how to orient ourselves and how to control the spacecraft it's time for us to fly to the moon generally the transmoon injection occurred in the middle of the second orbit around the earth, so about 2 hours and 45 minutes after the flight this is still carried out by the third stage of the Saturn 5, so the Apollo guidance computer should once again only have a passive role in monitoring the transparent injection with a dedicated P 15 program after separation from s 4b, we are in way since the next phase of testing is the moon landing, let's get straight to that once.
In lunar orbit, the separation between the command and service module and the lunar module occurs four hours and 45 minutes before landing on the lunar module, immediately after which rendezvous equipment such as strobe radar and VHF, as well as the IMU, which is realigned. Plus, there's a lot of prep work. In the lunar module, one of the main tasks is to prepare the AGS abort guidance system, which is another simpler computer that is capable of returning the lunar module to orbit with astronauts and safely docking it to the CSM in case of an emergency. Back to the power descent, the lunar module agency has a special program for that p6 TC braking front, the landing speed has been activated and updates the state vector, the Apollo guidance computer controls the combustion to reach the corridor correct towards the surface with a minimum amount of fuel this is completely automatic the astronauts simply sit during the trip the lunar module is oriented with this descent engine towards the moon the visibility for the astronauts is close to zero the second program P 64 is It starts automatically at about 8000 feet.
The lunar module is tilted so that the astronauts can actually see the ground and the lunar module commander is achieving a better landing at the landing site. I can look for a suitable place. The third p68 program maintains the lunar module in a stable attitude above the surface and the commander manually adjusts the altitude of one foot per second to slowly descend to the surface, ideally at that point the horizontal movement of the lunar module should be zero after landing, the crew manually activates program 68, which confirms to the Apollo guidance computer, then yes, we have indeed landed, ensures that Shutting down the engine interrupts the average g.routine and configures the autopilot in a very forgiving setting to avoid corrections when measuring the rotation of the moon, although the autopilot is not completely off as the s knob might need it in case of an emergency climb, well, on the moon we do the usual, a small step for the man, jump, plant the flag and then we jump right into the interesting parts with this takeoff and encounter.
The encounter technique was developed in the Gemini project. Here you can see the Agena rendezvous target in Earth orbit. Follow the principle. of an active vehicle, in this case the lunar module following the command service module and approaching it from below or a slightly faster orbit, there were actually two different ways of rendezvous, a more conservative method called elliptical rendezvous Co which required one and a half orbits for the lunar module to each command and service module, but provided ample opportunities to monitor progress midway. Orbit fixes and scenarios and a riskier direct rendezvous method that pointed the lunar module directly toward the command and service module taking less than one orbit to docking.
This was used starting with the Apollo 14 mission, since Mission Control had more experience and aimed for shorter times, less fuel in the intensive method, preparation had to start two hours before takeoff, we have to align the IMU and visually monitor the orbit of the CSM and calculate the circle with data the Apollo guidance computer has programmed 22 tracking CSMs for this purpose the left - one hour we start the program 12 power descent and feed it with the necessary data time of takeoff and speed objectives the Apollo grants Twitter performs the counter and asks To confirm it, we proceed and take off.
The trip to orbit lasts only seven and a half minutes, but depending on the method used to reach the target, it takes us between an hour and a half to three and a half hours to get back. the command service module during that time program 20 is running all the time measuring the state vector of the other vehicle the command service module through various peripherals such as the VHF antenna of the Rondo radar and the optical system for visual alignment calculates the necessary corridor and the respective maneuvers. The lunar module is required to enter an interception course.
Many other programs run in parallel to perform the necessary mid-course ignition maneuvers on the service module commander. The pilot is actively tracking the lunar module all the way to orbit the command and service modules. computers that calculate the state vector of the lunar module to assume the role of the active vehicle in case something goes wrong, the approach of the lunar module stops at a distance of 50 meters, at which point it turns to point its docking target at the top towards the command and service module at which time the command service module assumes the active role and activates the final rendezvous program 79 which slows down the command service module to shorten the distance to docking seconds before the contact the autopilot on both spacecraft shuts down to prevent both from trying to correct the attitude of the combined spacecraft so far, it's a good time to go home with the injection transfer, we feed the Apollo guidance computer with the parameters of the Earth's orbit and let it calculate the combustion, which deactivates and controls any type of possible mid-course correction. are performed in exactly the same way once in orbit around the Earth the reentry parameters are calculated on the ground and transferred to the Apollo guidance computer via an uplink spent the first entry program p-61 the preparation of entry begins at the entrance - 25 minutes landing parameters with barriers such as latitude and longitude of the splash zone, as well as speed and angles for entering the atmosphere are requested, upon entry, confirming these values ​​completes the program 61 and starts program 62, which basically asks the astronaut to complete a checklist for the separation of the service module from the manual command module that is not controlled. by the Apollo guidance computer after this has been performed it automatically switches to program input 63 in an image of the Steelies early hoist at that point the autopilot takes over control of the thruster to take the command module out of its orbit towards the Earth's atmosphere the main program is for re-entry is the input of program 64 which starts automatically program 64 monitors the trajectory and splashdown location which determines the best input solution a potential speed reduction by invoke two specific programs, either the p65 entry control which basically makes the current module navigate in the atmosphere to reduce speed and extend the range or program 66 ballistic entry launching us into the atmosphere like a cannonball the correct combination of the two are decided by the program 64 the last program program 67final phase performs the final maneuvers until the splash the next steps such as parachute deployment, etc., and is not performed by the Apollo guidance computer, but by the ELS.
See the landing sequence controller on Earth. The drop from the Apollo guidance computer was done before deploying the parachutes, so this was a nice nominal mission. What can go wrong? Well, let's start with Apollo 11, which had a 1202 Milan program during the power down, normally the programs during the power down used about 85% of the computer's processing power, but due to incorrect design of the power supply, the round oval radar Rhonda burr generated an additional twelve thousand eight hundred. unintentional instructions per second, ironically, equal the exact 15 percent additional load due to cooperative multitasking, a job queue built up resulting in an executive flyover and alarm 1202, the operating system automatically performed an aborted program, our Jobs were canceled and all restarted.
This took only a few seconds and the landing could begin on the next Apollo 13. They had an explosion of the oxygen tank in the service module at 55 hours 54 minutes 53 seconds and yes they will correct 320,000 kilometers from Earth unfortunately they were able to make use of the trajectory free return. for the astronauts to return to Earth, but they had to move to the lunar module to survive, as the command and service module was completely shut down, including its Apollo guidance computer, the IMU configuration had to be transferred to the system of the lunar module, first adapted to the different orientations of the spacecraft manual burns in the mid-course corrections were actually made with the abort guidance system in the lunar module due to power limitations with the Apollo guidance computer replays successful restart of the command and service module computer was fortunately done hours before returning -Entry and last but not least, Apollo 14, which had a floating solder ball on the abort button that could cause an unwanted activation of the abort, thus returning the lunar module to orbit, this was resolved within hours by reprogramming the Apollo guidance computer and disproved the execution. from a different show that wasn't listening to the cancel button during the party sent an actual cancel activation, they would have to be activated manually via the disk key so this was an overview and how the mission software was used on a flight to the moon and back.
Now you probably want to run your own code on a real Apollo guidance computer, so you need to know where to find it. A total of 142 computers were built. Seven lunar module computers crashed into the moon. Three lunar module HTCs burned up in Earth's atmosphere. 11 command module computers. returned, presumably parts of museum exhibits, and 21 machines did not fly. Little is known about the ones on display at the Computer History Museum in Mountain View, California, but they are missing some components; Fortunately, several emulation solutions are publicly available, as well as a toolchain and the full source of the mission originally the size of a medium suitcase is available on github it takes a village to create a presentation we would like to thank everyone who helped us helped and supported this includes the indirect contributors who wrote the books original documentation the websites and software thank you very much for your attention thank you good luck wow it was a densely packed talk thank you Miguel and thank you dis Yan for this incredible overload of information please give a warm round of applause because we can't have a Q&A unfortunately

If you have any copyright issue, please Contact