Microcode inside the Intel 8087 floating-point chip: register exchange

In 1980, Intel introduced the 8087 floating-point chip, a co-processor that made floating-point operations up to 100 times faster. This chip was highly influential, and today most processors use the floating-point standard introduced by the 8087.

The 8087 uses complicated algorithms to accurately compute functions such as square roots, tangents, and exponentials. These algorithms are implemented inside the chip in low-level code called microcode. I'm part of a group, the Opcode Collective, that is reverse-engineering this microcode. In this post, I take a close look at the microcode for one of the 8087's instructions—FXCH—and explain how the microcode works. The FXCH (Floating-point Exchange) instruction exchanges two floating-point registers. You might expect this instruction to be trivial, but there's more going on than you might expect; the microcode uses 14 micro-instructions to implement the exchange instruction.

The Intel 8087 chip is packaged in a 40-pin DIP (dual in-line package).

The Intel 8087 chip is packaged in a 40-pin DIP (dual in-line package).

To explore the microcode, I opened up an 8087 chip and created a high-resolution image with a microscope. The large microcode ROM occupies a central position, holding the micro-instructions that control the chip. The microcode engine on the left steps through the microcode, handling jumps and subroutine calls. The bottom half of the chip is the "datapath", the circuitry that performs floating-point calculations; it is split into a 16-bit datapath for the number's exponent and a 64-bit datapath for the number's fractional part (also known as the significand).

Die of the Intel 8087 floating-point unit chip, with main functional blocks labeled. The die is 5mm×6mm.  Click for a larger image.

Die of the Intel 8087 floating-point unit chip, with main functional blocks labeled. The die is 5mm×6mm. Click for a larger image.

This post focuses on the temporary registers and stack registers that are highlighted in red. The chip has two temporary registers and eight stack registers, each holding a number's exponent and fraction. Each register also has two tag bits that label the type of value in the register. The stack control circuitry at the right manages the stack, keeping track of the top-of-stack position as values are pushed onto the stack or popped off the stack.

The 8087's microcode

Executing an 8087 instruction such as arctan requires hundreds of internal steps to compute the result. These steps are implemented in microcode with micro-instructions specifying each step of the algorithm. (Keep in mind the two levels of instructions: the assembly language instructions used by a programmer and the undocumented low-level micro-instructions inside the chip.) The microcode ROM holds 1648 micro-instructions, implementing the 8087's instruction set. Each micro-instruction is 16 bits long and performs a simple operation such as moving data inside the chip, adding two values, or shifting data. I'm working with the Opcode Collective to reverse-engineer the micro-instructions and fully understand the microcode (link).

The 8087's micro-instructions are complicated, with many corner cases and ad hoc functions, but I'll provide a simplified overview. Each micro-instruction consists of 16 bits, as shown below. The first three bits specify the type of the micro-instruction, which controls the meaning of the remaining bits. The first type indicates a transfer operation, transferring data from one internal register to another. The two fields specify the source and destination for the data. The three unspecified bits are used for various special cases. Next is a shift operation, which uses the barrel shifter to shift a value left or right. The third type of micro-instruction uses the adder/subtractor. It can also be used in a loop for multiplication or division. Fourth are various arithmetic control micro-instructions that configure the adder, set rounding modes, and so forth. The far jump and far call micro-instructions perform a jump or subroutine call to a target micro-address in a fixed list. The condition field allows conditional jumps/calls based on numerous conditions, while the last bit inverts the condition. A local jump allows a conditional jump to a nearby micro-instruction. Finally, the miscellaneous micro-instructions range from returning from a subroutine or raising an exception to ending the microcode execution.

Structure of an 8087 micro-instruction.

Structure of an 8087 micro-instruction.

How values are stored inside the 8087 chip

The 8087 supports a variety of data types: floating-point numbers of various sizes, integers, and binary-coded decimal. But internally, everything is stored as an 80-bit floating-point number. A number has three parts: a 64-bit significand (the fractional part), a 15-bit exponent, and a sign bit. The chip has two separate data paths: one for the significand, and one for the exponent and sign.

The chip has eight registers to store numbers during calculations, the top registers in the diagram below. However, the registers are organized in an unusual way: as a stack, with numbers pushed to the stack and popped from the stack. Instead of accessing, say, register #3, you might access the third register from the top of the stack, denoted ST(3); as values are pushed or popped, ST(3) changes. The stack-based architecture was intended to improve the instruction set, simplify compiler design, and make function calls more efficient, although it didn't work as well as hoped.

The register set of the 8087, as seen by the programmer. From 8086 Family Numerics Supplement.

The register set of the 8087, as seen by the programmer. From 8086 Family Numerics Supplement.

Many 8087 instructions act on the top of the stack. For instance, the square root instruction replaces the value on the top of the stack with its square root. But what if you want to take the square root of a value in the middle of the stack? The solution is the FXCH instruction, the focus of this article. This instruction exchanges the value on the top of the stack with a specified stack position, providing access to values inside the stack.

One more feature of the 8087 is important to this discussion: each value in the register stack has an associated "tag" value, labeling it as valid, special, zero, or empty. A "normal" floating-point value is tagged as valid. If the floating-point value is infinity, Not a Number, or a denormalized value, then it is tagged as special. A zero value is tagged as zero. Finally, if a register is empty (e.g., its value has been popped off the stack), the register is tagged as empty. The 8087 uses tags to optimize performance and detect errors.1 For instance, if a programmer pops too many values from the stack and tries to read a stack register that is tagged empty, the 8087 raises an "invalid operation" exception.

The eight stack registers are visible to the programmer, but the 8087 also has temporary registers that it uses internally. Two of these temporary registers are important for this article: tmpA and tmpB. Like the stack registers, each temporary register is an 80-bit register, along with two tag bits.

The FXCH microcode

In this section, I'll explain how the microcode for the FXCH exchange instruction works. This instruction exchanges the top-of-stack register with the register at a specified position in the stack. If either register is empty, the instruction will raise an "invalid operation" exception and replace the missing value(s) with the special value "Not a Number" (NaN).

The microcode for the instruction is below, consisting of 14 micro-instructions.2 The first micro-instruction is a transfer, where the source is the top of stack value ST(0) and the destination is the temporary A register. The source specification causes the 64 significand to be placed on the fraction bus, the 16-bit exponent and sign to be placed on the exponent bus, and the two tag bits to be sent to the tag circuitry. The destination tmpA causes the bus values to be stored into the temporary register. Thus, the bits in the micro-instruction cause the desired transfer to take place. The third micro-instruction is similar, but uses a register inside the stack, ST(i), with the index specified in the machine instruction.

FXCH entry point:
#0200 ST(0) -> tmpA           read top of stack
#0201 nop                     Wait a cycle
#0202 ST(i) -> tmpB           Read specified stack register
#0203 if !(tmpA or tmpB empty) jmp #0210 Jump if both registers exist
#0204 set invalid exception   Raise an invalid exception
#0205 if (unmasked) jmp #0213 If interrupt, end
#0206 if !(tmpA empty) jmp #0208 Check if tmpA is empty
#0207 NaN -> tmpA             If so, move NaN to tmpA
#0208 if !(tmpB empty) jmp #0210 Check if tmpB is empty
#0209 NaN -> tmpB             If so, move NaN to tmpB
The happy path and error path continue here:
#0210 tmpB -> ST(0)           Save tmpB to the top of stack
#0211 nop                     Wait a cycle
#0212 tmpA -> ST(i)           Save tmpA to the specified stack register
#0213 RNI                     End of routine: Run Next Instruction
#0214 nop                     Unused
#0215 nop                     Unused
#0216 nop                     Unused

Next, the relative jump at micro-address #0203 illustrates a different type of micro-instruction: the conditional jump. The micro-instruction specifies a condition, in this case, testing if either temporary register is empty. (That is, the hardware tests the tag bits associated with the temporary registers to see if either is the "empty" tag.) The micro-instruction has a bit set to invert the condition. Finally, the micro-instruction has an offset of +6, yielding the jump target #0210. The advantage of a relative offset over specifying a full micro-address is that the offset only requires six bits. (For more information on how conditions are evaluated, see my article Conditions in the Intel 8087 floating-point chip's microcode.)

If either register is empty, the next micro-instruction raises an "invalid" exception. As I'll explain in the next section, you can program the 8087 to either generate an interrupt on an exception or continue processing. The next instruction is a conditional jump that tests if the exception was "unmasked", indicating that an interrupt was generated. In this case, the microcode ends while the main 8086 processor handles the interrupt.

Assuming the interrupt was masked, the microcode now replaces empty values with the special Not a Number value, first checking tmpA and then tmpB. The source NaN causes circuitry to pull the exponent bus to all 1's and the fraction bus to all 0's, except for the top two bits. This particular bit pattern represents Not a Number.3

At micro-address #0210, the empty-register path and the normal path join up to store the temporary registers in the stack registers. This is where the actual exchange operation happens, since tmpA and tmpB are written to the opposite stack positions from where they were read. Finally, RNI (Run Next Instruction) indicates the end of the microcode routine. This stops the microcode engine and gets the 8087 ready for the next instruction.

The nop (no-operation) microcode instructions are interesting. Each pair of stack reads or writes has a nop in the middle, probably due to timing constraints on the registers. The end of the microcode routine has three nop instructions before the next microcode routine starts. These instructions appear to be wasted space in the microcode; maybe the FXCH microcode was shortened by three words during development, causing this gap.

Exceptions

The 8087 has a complicated exception system to handle a variety of problems. Exceptions fall into six categories: invalid operation, denormalized operation, zero divide, overflow, underflow, or precision. An invalid operation occurs, for instance, if you take the square root of a negative number or try to perform an operation on an empty register. An overflow exception occurs if a value is too large to be represented, while an underflow exception occurs if a value is too small. A zero divide exception happens if you divide by zero.4 A precision exception occurs if a number cannot be exactly represented as a floating-point number (which is extremely common). Finally, a denormalized exception occurs if a value is too close to zero to be represented with full accuracy.

What happens if an exception occurs? The 8087 allows the programmer to select exception behavior for each exception type. The first option is for an exception to trigger a CPU interrupt, so the software can handle the problem. For instance, the software could attempt to work around the problem, log an error, or simply terminate the program. Alternatively, the programmer can "mask" an exception. In this case, the 8087 continues the operation in a "reasonable" way. For instance, an overflowed value would be set to infinity, while an invalid value would be set to the special value: "Not a Number" (NaN). For a precision exception (e.g., 1/3), the value is rounded. The designers of the 8087 put a lot of effort into continuing after a masked exception in the best way; the manual has pages of details on all the special cases.5

Handling of exception conditions is split between microcode and hardware. For example, if the FXCH microcode detects an empty register, it executes a set invalid exception micro-instruction. This micro-instruction sets a latch indicating the invalid exception. The 8087's control register includes six mask bits, one for each type of exception, blocking interrupts for that exception type. The hardware combines the exception flip-flop signals with the mask bits in the control register and the exception flags in the status register to see if a new, unmasked interrupt has been triggered. If so, the 8087 circuitry sends an interrupt to the 8086 processor.

On the other hand, if the interrupt is masked, execution of the microcode continues. In the case of FXCH, the microcode replaces empty registers with the Not a Number value. Finally, the microcode routine ends with RNI (Run Next Instruction). This triggers many hardware activities, but the relevant one is copying the state of the exception flip-flops into the status register. This sets the exception bit if the programmer wants to check it. The exception flip-flops are cleared when the next 8087 instruction starts. Since the hardware manages the flip-flops, status register, control register, and interrupt line, the microcode can be simpler and smaller.

Extracting the microcode

The 8087's microcode ROM contains 26,368 bits, specifying 1648 16-bit micro-instructions. At the time, this was a very large ROM; in order to fit it on the die, Intel used a special type of ROM that held two bits per transistor, twice the capacity of a standard ROM. This ROM is semi-analog, using four sizes of transistors to produce four voltage levels. Comparators convert the voltage level to a pair of bits.

A close-up of the 8087's microcode ROM, showing 77 transistors. A transistor is formed where a vertical polysilicon line crosses a horizontal stripe of doped silicon.

A close-up of the 8087's microcode ROM, showing 77 transistors. A transistor is formed where a vertical polysilicon line crosses a horizontal stripe of doped silicon.

To extract the microcode, I took high-resolution images of the ROM after dissolving the metal layer. Gloriouscow used a neural network to categorize the size of each transistor. (You can explore the full image and transistors here.) The next step was determining how to map the transistors to bits. You might expect that the grid of transistors corresponds to the grid of microcode bits. But due to various hardware optimizations, rows and columns are shuffled and mirrored, which I sorted out by studying the circuitry. The result was the microcode, expressed as a table of 0's and 1's.

The next step was assigning meaning to the microcode. For the 8086 processor, the patent provided a lot of detail on the structure of the microcode and the hardware, but the 8087 patent didn't explain the microcode. Instead, we figured out the micro-instructions through a combination of examining the circuitry, looking for patterns in the microcode, and thinking about how instructions might be implemented.

Microcode is usually complicated, and the 8087 is worse than most. The 8087 was on the edge of what was possible at the time, so the designers resorted to special cases and hacks where necessary. For instance, some conditional jumps have side effects such as updating registers. Other instructions set flip-flops that change the behavior of later operations. We're still working to completely understand the micro-instructions at the hardware level.

I plan to continue reverse-engineering the 8087 microcode; for updates, follow me on Bluesky (@righto.com), Mastodon (@[email protected]), or RSS. I've been working on this with the members of the "Opcode Collective", especially Smartest Blob and Gloriouscow, who converted the ROM images to microcode data and extensively analyzed the contents. See the 8087 repository on GitHub for more.

AI statement: Despite the presence of the em dash, no AI was used in the writing of this article (details).

Notes and references

  1. Tags are normally invisible to the programmer, but can be accessed through special operations. A programmer can access the 8087 tags by dumping the 8087's state to memory; the tags are stored in a 16-bit "tag word". 

  2. The raw 8087 microcode is available here, decoded by Smartest Blob. I've modified the microcode format for clarity. 

  3. The 8087 indicates a bad value with a special "Not a Number" (NaN) value. The system allows many different representations of NaN: any value with an exponent of all 1's, a nonzero significand (a zero significand indicates negative infinity), and either sign. For an invalid operation, the 8087 uses one particular NaN value, called real indefinite. For an internal 80-bit real number, this value has the top two bits of the significand set internally, and the rest zero, while the exponent bits and sign are all set. (See pages 87 (S-73) and 90 (S-76).) A 32-bit or 64-bit real uses a slightly different bit pattern for NaN; these number formats have an implied "1" bit for the significand, so only one bit of the significand is explicitly set for the real indefinite NaN. 

  4. Dividing by zero usually causes a zero divide exception, but 0 ÷ 0 causes an invalid operation exception, while infinity ÷ 0 is valid, yielding infinity. Just one reason why the microcode is so complicated. 

  5. For more information on the 8087's exceptions, see 8086 Family Numerics Supplement. The exception system is described on page 32 (S-18). The exception flags and exception masks are described on page 24 (S-10). The details of exception handling are described on page 89 (S-75). 

Reverse engineering circuitry in a Spacelab computer from 1980

Spacelab was a reusable laboratory that could be carried in the cargo bay of the Space Shuttle, providing lab space for astronauts and experiments. Spacelab was controlled by a French-built minicomputer, called the Mitra 125 MS. Unlike modern computers, this computer didn't contain a microprocessor chip. Instead, its 16-bit processor was constructed from several boards of chips. In this article, I reverse-engineer one of the processor boards, shown below, part of the computer's Arithmetic/Logic Unit (ALU).

The Mitra 125 MS computer, built by CIMSA, with one of the ALU/register cards shown.

The Mitra 125 MS computer, built by CIMSA, with one of the ALU/register cards shown.

Spacelab consisted of a pressurized cylindrical laboratory that held experiments, computers, and work areas for researchers. A tunnel connected the laboratory to the Shuttle, allowing researchers to move between the Shuttle and Spacelab. Spacelab also supported up to five unpressurized "pallets" that were exposed to space, holding experiments such as telescopes and sensors. The illustration below shows the tunnel, the Spacelab laboratory, and a pallet installed in the Shuttle's cargo bay.1

Illustration of the Spacelab-3 mission. From NASA.

Illustration of the Spacelab-3 mission. From NASA.

Because Spacelab was a European project, it used a European computer, the Mitra 125 MS. The Mitra line started in 1971 when a French company called CII introduced the Mitra 15 minicomputer, a 16-bit computer that used magnetic core memory. Mitra is a French acronym2 that translates as "Mini-machine for Real-Time and Automatic Computing." As the name suggests, Mitra was both small and designed for real-time computing, making it suitable for controlling experiments. The Mitra 15 was a popular computer, with almost 8000 units sold.

In 1975, CII produced a successor called the Mitra 125. The Mitra 125 improved on the Mitra 15 by adding memory management, I/O processors, higher performance, and additional instructions. Spacelab used the Mitra 125 MS minicomputer,3 a militarized variant of the Mitra 125 that was produced by a company called CIMSA. A Spacelab mission had three of these computers: the Subsystem Computer controlled and managed Spacelab itself, while the Experiment Computer handled the experiments. A Backup Computer could take over if either computer failed.1 These computers were part of Spacelab's Command and Data Management Subsystem, which controlled experiments and collected data.4

The three computers were normally mounted in the Spacelab laboratory underneath the Work Bench Rack (details). The computers were controlled through a keyboard and a color CRT display, called the Data Display System (DDS). The computer installation and a DDS are visible in the photo below.

This photo shows astronauts inside Spacelab (but not in space). The Spacelab computers were mounted under the Work Bench (right arrow). The Data Display System (left arrow) provided the interface to the computers. Photo is STS-51B Crew Portrait, 1984.

This photo shows astronauts inside Spacelab (but not in space). The Spacelab computers were mounted under the Work Bench (right arrow). The Data Display System (left arrow) provided the interface to the computers. Photo is STS-51B Crew Portrait, 1984.

For some Spacelab missions, the laboratory was omitted entirely, providing more room for experiment pallets. In this case, the computers were mounted in a small pressurized cylinder called the igloo. The researchers remained in the Shuttle, controlling experiments through two Data Display Systems that were mounted in the Shuttle's rear flight deck (photo).

The 74181 ALU chip

The Spacelab computer didn't use a microprocessor chip. Instead, like most minicomputers at the time, it was built from simple integrated circuits that were combined to implement the computer's circuitry. Unlike modern CMOS integrated circuits, these chips contained bipolar transistors, which were fast, but large and power-hungry, a technology known as TTL (transistor-transistor logic). Electronics hobbyists of a certain age will recall the popular 7400 series of TTL chips. The Spacelab computer was built from the military grade of these chips, the 5400 series.

The most complex chip in the computer was probably the '181 Arithmetic/Logic Unit (ALU) chip, containing about 170 transistors. The arithmetic/logic unit is the heart of a computer, performing arithmetic operations as well as Boolean logic operations. In 1970, Texas Instruments put a complete 4-bit arithmetic/logic unit on a single chip, called the 74181. Since the chip was fast, compact, and inexpensive, it was widely used, providing the ALU in computers from the popular PDP-11 and Xerox Alto to the powerful VAX-11/780 "superminicomputer".

The 74181 provides a full set of binary logical operations, including AND, OR, XOR, and complement. For arithmetic, it includes addition, subtraction, incrementing, and decrementing.5 Inconveniently, the 74181 doesn't support shifting right. Moreover, multiplication and division were much too complicated to be included in the 74181. Instead, a processor implemented multiplication and division through repeated addition or subtraction, combined with shifting. Likewise, floating-point operations were way beyond the capability of the 74181, but a processor could use the 74181 when performing the steps of a floating-point operation.

Although the 74181 only handled four bits, multiple 74181 chips could be combined to handle larger words, such as 16 bits or 32 bits. To handle carries, the chips could be chained together, with the carry-out from one chip fed into the carry-in of the next chip. This approach was simple but slow, since the carry had to "ripple" through all the chips before the answer could be obtained. The carry process could be sped up by using a carry-lookahead chip called the 74182, which speeds up addition by computing the carries from four 74181 chips (i.e., 16 bits) in parallel.

The Mitra's ALU/register boards

The Spacelab computer used eight '181 ALU chips to implement a 32-bit adder.6 (Specifically, these chips are the 54S181, a variant of the 74181: "54" indicates that the chips handle the military temperature range, and "S" indicates that the chip is built from high-speed Schottky logic.) However, the ALU boards required numerous additional chips. Depending on the instruction, eight different inputs could be selected for the ALU. Chips called multiplexers selected the desired value, requiring 32 multiplexer chips. Three 32-bit registers provided storage for ALU inputs and outputs, requiring 24 chips. Two 54S182 carry-lookahead chips provided fast carry computation. Finally, some simple logic chips (inverters and NAND gates) tied things together.

Due to the number of chips required, the ALU/register circuitry was spread across three boards, as shown below. (I reverse-engineered the board on the right.7) The '181 chips are immediately visible as they are much larger than the other chips; they have 24 pins, compared to 14 or 16 pins for the other chips. The first board has two '181 chips, while the last two boards each have three '181 chips. The last two boards are similar, but not identical.

The three ALU/register boards from the Spacelab computer.
Click this image (or any other) for a larger version.

The three ALU/register boards from the Spacelab computer. Click this image (or any other) for a larger version.

Finding a 32-bit ALU was a surprise to me, since the computer is a 16-bit computer. The expanded ALU was probably implemented to improve performance. Multiplying two 16-bit numbers yields a 32-bit result, so a 32-bit ALU makes multiplication faster. Moreover, the computer supports 32-bit floating-point numbers, so the 32-bit ALU presumably makes floating-point operations faster.

The diagram below shows the architecture of the computer's 32-bit ALU system. In the middle is the ALU itself, operating on two 32-bit operands: A and B. At the left, multiplexers ("mux") select one of four values for A and one of four values for B. At the right, the output of the ALU can be stored in three 32-bit registers, or sent to the rest of the computer via the bus. The first two registers are shift registers, allowing the value to be shifted left or right, while the third register simply holds the value in flip-flops. The first two registers are connected by buses to the rest of the computer, while the value of the third register can only be accessed by using it for another arithmetic operation.8 I suspect that the shift registers are used for multiplication and division to shift the arguments at each step.

Block diagram of the ALU/register board.

Block diagram of the ALU/register board.

The inputs to the multiplexers provide flexibility. For instance, you can add register 1 to a number from the bus, or add register 2 shifted to the right to register 3. (Note that this shifting is implemented by wiring the inputs to the multiplexer shifted left or right, completely separate from the shift register's shifting.) The "all 1's" input is either a zero input (with negative logic), or -1 (in two's-complement). The B input can be taken from the bus, allowing the value to come from memory or from a general-purpose register. The mix input is a jumble of signal lines, register bits, a shift register input, and a pull-up with no apparent pattern. I describe a few more mysteries in the footnote;9 presumably, the mysteries would be resolved if I reverse-engineered the whole computer.

The functions of the multiplexers, ALU chips, and registers depend on what instruction is being executed. Specifically, the computer's microcode engine generates control signals for the computer, including the ALU/register boards. Some of these control signals select which multiplexer inputs are used. Other control signals select the ALU's function. Finally, control signals select which register receives the ALU's output.

The board that I reverse engineered implements 12 of the 32 bits of the ALU and registers. The image below shows the role of each chip on the board. The three 4-bit ALU chips are indicated 2, 1, and 0. Each ALU chip has two multiplexer chips to select the four A input bits and two multiplexer chips to select the four B input bits.10 Thus, there are 12 multiplexer chips on the board. The three 12-bit registers A, B, and C are each implemented with three 4-bit chips. Three hex inverter chips and a 4-input NAND chip complete the board.11

The ALU/register board with the chips labeled.

The ALU/register board with the chips labeled.

These printed-circuit boards (PCBs) have some interesting features. In most electronics, circuit boards have holes only where they are needed, but the Spacelab boards have holes in a fixed grid pattern. (IBM used similar boards in its System/360 computers in the 1960s.12) A hole can hold an IC pin or other component. Or a hole can be used as a via, connecting PCB traces on different layers. Another interesting feature of the boards is the vertical metal bars underneath the integrated circuits. These bars carry heat away from the integrated circuits.

The PCB traces are more visible on the back of the board (below). The traces are thin enough that two traces can pass between a pair of holes. Note the yellow "bodge" wires, correcting errors on the circuit board. I assume that these errors were fixed for the computers used in flight.

Back of an ALU/register board. This is a different board from the one I reverse engineered, since I wanted to show the yellow wires.

Back of an ALU/register board. This is a different board from the one I reverse engineered, since I wanted to show the yellow wires.

Each board has a 96-pin connector at the bottom, which plugs into the computer's motherboard. Note the three cylindrical pins sticking out of the connector. These pins are keyed to ensure that a board can only be plugged into the correct slot. That is, each pin has a metal tab oriented in one of six directions. On the motherboard, the connectors have corresponding notches. If the tabs and the notches don't match up, the board can't be plugged in.

A close-up of the connector, showing the keying. Also note that the zig-zag pin numbering on the left changes to an irregular number on the right. Unexpectedly, pin 52 is between pins 49 and 51, for example,

A close-up of the connector, showing the keying. Also note that the zig-zag pin numbering on the left changes to an irregular number on the right. Unexpectedly, pin 52 is between pins 49 and 51, for example,

The boards in the Spacelab computer are dense, tightly packing integrated circuits to minimize the size of the computer. However, the boards are considerably less dense than American aerospace computers. In particular, the Spacelab computer used the same integrated circuit packages that were used in consumer electronics: through-hole DIPs (dual in-line packages with two rows of pins). In contrast, IBM's line of 4 Pi aerospace computers used "flat-pack" integrated circuits that were considerably smaller and thinner (details). As a result, IBM's double-sided circuit boards could hold 156 integrated circuits compared to 30 on a single-sided Mitra board of roughly the same size.

A brief history of the French computer industry leading up to this computer

Bull is one of France's earliest computing companies, created in 1931. Bull initially sold punch-card equipment, competing with IBM. By the 1960s, Bull was a major computer company with products such as the transistorized Gamma 60 computer, a large-scale mainframe that was said to be the first system specifically designed for parallel and multiprogramming. Unfortunately, Bull had difficulty competing with IBM, its stock collapsed, and Bull was acquired by General Electric in 1964, forming Bull-GE. The collapse and controversial takeover were a blow to the French computer industry, and the incident was dubbed the Affaire Bull. To make things worse, GE soon canceled two of Bull's computers, focusing instead on GE's computer line.

The Affaire Bull was not only an affront to French pride, but an indication that France was largely dependent on the US for computer technology. A second incident revealed the critical military consequences of France's weakness. In the early 1960s, France was attempting to improve its nuclear strength by develop a hydrogen bomb. The mathematics of fusion is computationally intense, so France attempted to buy powerful American computers: the CDC 6600 supercomputer and the IBM 360/92.13 However, the US government blocked the export of these computers to France in an attempt to limit nuclear proliferation.

These problems led French president Charles de Gaulle to decide that France needed a strong computer industry of its own. In 1966, he developed a plan for computing (Plan Calcul)14, where the French government would reorganize the computer industry, picking companies to lead in each sector from minicomputers to semiconductors.

In the minicomputer sector, the government created a company called CII by combining three French computer companies: SEA, CAE, and SETI. CII was primarily owned by a large French company called Thomson-CSF (now Thales).15 CII played a key role in the Spacelab computer, since CII developed the Mitra line of computers. In the mid-1970s, CII and the American company Honeywell merged, with the computer division spun off to form a new company called SEMS, with majority shareholder Thomson. Another Thomson subsidiary, CIMSA, focused on military electronics and produced the militarized versions of the Mitra line. In particular, CIMSA produced the computer for Spacelab.16

France's Plan Calcul is generally viewed as a failure. Despite expensive subsidies, the French computer industry remained weak and unable to escape American dominance. When Giscard d'Estaing was elected president of France in 1974, he ended Plan Calcul. There are various interpretations, such as the failure of government planning versus the free market, but my view is that in the 1960s and 1970s, IBM crushed most challengers in the computer industry, both American and foreign, so Plan Calcul didn't have a chance. As for Bull, the company went through a dizzying sequence of American takeovers and nationaizations by France.17 Just two months ago (March 2026), the company was reacquired by the French government.

Replacement by the IBM AP-101SL computer

Since Spacelab was a European project, using a European computer was a point of pride. Unfortunately, the French computers were eventually replaced by IBM computers due to performance needs and undoubtedly political factors.

During the Space Shuttle program, the computers on the Shuttle and in Spacelab became obsolete as computer technology rapidly advanced. Although the computers were originally considered powerful, their performance and memory capacity became problems over time. The Space Shuttle's IBM AP-101 computers were upgraded to IBM AP-101S computers, first flying in 1991. The AP-101S was half the size, three times faster, and had more than twice the memory, using semiconductor memory instead of magnetic core memory.

The Spacelab computer system needed a similar upgrade, and in 1991, the CIMSA computers on Spacelab were replaced with IBM AP-101SL computers. The AP-101SL was based on the Shuttle's upgraded AP-101S computer, but modified to support the Mitra's hardware architecture, instruction set, and I/O capabilities. The packaging of IBM's computer was slightly changed to match the dimensions of the CIMSA computer and to use an external heat exchanger rather than an internal heat exchanger.

The IBM AP-101SL Spacelab computer. The circuit boards are much larger than the original Spacelab computer boards or the original AP-101B boards. Note the flat-pack ICs on the boards. Photo courtesy of Kyle Owen.

The IBM AP-101SL Spacelab computer. The circuit boards are much larger than the original Spacelab computer boards or the original AP-101B boards. Note the flat-pack ICs on the boards. Photo courtesy of Kyle Owen.

Changing the Shuttle's 32-bit AP-101S computer to run the 16-bit Mitra instruction set was easier than you might expect, since the AP-101S already supported multiple instruction sets: a 32-bit instruction set derived from the IBM System/360 and a 16-bit instruction set called 1750A that was an Air Force Standard. Because the AP-101S implemented its instructions in microcode—low-level software that specified the steps of a machine instruction—the instruction set could be modified by updating the microcode.

I compared the circuit boards in an AP-101S with the boards in an AP-101SL to quantify the changes. The semiconductor memory boards and power supplies were essentially identical. The CPU boards had minor changes. Unsurprisingly, the I/O boards were completely different, and the complex I/O Processor (IOP) in the Shuttle's AP-101S was omitted. For more on the IBM AP-101 line, see my History of IBM's 4 Pi computers.

Conclusions

The Spacelab computer provides an interesting look at how computers were built before microprocessors took over. The components of a computer, such as the ALU, registers, and control circuitry, were constructed from simple chips. Since each chip didn't do much, the computer required 36 boards full of chips. Even so, the computer was compact enough to go into space. By modern standards, these computers aren't much—each computer had a memory capacity of just 128 KB of magnetic core memory—but they played a critical part in the space program.

I'm not going to reverse-engineer the full computer, but I may write some more about it. For updates, follow me on Bluesky (@righto.com), Mastodon (@[email protected]), or RSS.

Credits: Thanks to Steve Jurvetson for providing the Spacelab computer for examination. Thanks to Poul-Henning Kamp for comments.

AI statement: Despite the presence of the em dash, no AI was used in the writing of this article (details).

Notes and references

  1. For details on Spacelab, see Spacelab News Reference

  2. To avoid cluttering the main article, I'll summarize the French acronyms and companies in this footnote.

    • CAE: Compagnie européenne d'automatisme électronique (European Electronic Automation Company). A French computer company founded in 1960, selling versions of American computers such as TRW's RW-300. Part of the 1966 merger that formed CII.
    • CII: Compagnie internationale d'informatique (International Computer Company): the company that created the Mitra line of minicomputers. CII also sold computers designed by the American company SDS (Scientific Systems), which was bought by Xerox in 1969 and became XDS (Xerox Data Systems). XDS was shut down in 1975, costing Xerox hundreds of millions of dollars.
    • CIMSA: Compagnie d'informatique militaire, spatiale et aéronautique (Military, Space, and Aeronautical Computing Company): the company that manufactured the Spacelab computer.
    • CSF: Compagnie Générale de Télégraphie Sans Fil (General Wireless Telegraphy Company). A radio company dating back to 1918. It merged with Thomson in 1968 to form Thomson-CSF.
    • MATRA: Mécanique Aviation Traction (Mechanics-Aviation-Traction). An electronics company that was the contractor for Spacelab's data systems.
    • Mitra: Mini-machine pour l'Informatique Temps Réel et Automatique ("Mini-machine for Real-Time and Automatic Computing"). A line of minicomputers.
    • SEA: Société d'électronique et d'automatisme (Electronics and Automation Company): a French computer manufacturer, started in 1947 and merged into CII in 1966.
    • SEMS: Société Européenne de Mini-informatique et de Systèmes (European Society for Minicomputers and Systems). A subsidiary of Thomson, created by the French government in 1976 during the merger of CII and Honeywell. SEMS took over the manufacturing of Mitra computers from CII.
    • SETI: Société européenne de traitement de l'information (European Information Processing Society). SETI was a French computer company formed in 1961. The American computer company Packard Bell owned a quarter of SETI, and SETI sold the desk-sized Packard Bell 250 computer.
     

  3. On the ground, the Spacelab project used Mitra 125 S computers that were functionally identical to the Mitra 125 MS (details). 

  4. Spacelab's Command and Data Management Subsystem (CDMS) is surprisingly complicated because of the data communication paths between Spacelab, the Shuttle, and the ground. Moreover, multiple units store, encode, and decode data. In the CDMS block diagram below, I've highlighted the three computers; they are just a small part of the CDMS. See Section 3.5 of Spacelab News Reference or The Command and Data Management System of Spacelab for details on CDMS.

    A block diagram of Spacelab's Command and Data Management Subsystem. From The Command and Data Management System of Spacelab. Click for a larger version.

    A block diagram of Spacelab's Command and Data Management Subsystem. From The Command and Data Management System of Spacelab. Click for a larger version.

     

  5. I reverse-engineered the 74181 ALU chip in this article and explained the motivation for its quirky set of operations in this article

  6. Another board in the Spacelab computer has four 74S181 chips implementing a 16-bit ALU. My guess is that this board is part of the I/O processor. The board has the cryptic label "HMSG". 

  7. My reverse-engineering process was straightforward but tedious. I used a multimeter to beep out the connections between the integrated circuits as well as the connections to the connector. (Unlike many systems that I look at, these boards didn't have conformal coating, which made beeping out the connections practical.) I created a schematic in KiCad from this data; this schematic was "physical", with the layout of the chips and pins matching their physical location on the board. Next, I converted the integrated circuit symbols from physical rectangles to logical symbols. Finally, I moved the symbols around on the schematic to make a reasonable schematic. (I had to go back and beep out more connections as I discovered errors or missing connections.) Theoretically, I could reverse-engineer the entire computer, but reverse-engineering one of the 36 boards is enough for me. 

  8. My full reverse-engineered schematic of the ALU/register board is below. Click for a larger version.

    Schematic of the ALU/register board.

    Schematic of the ALU/register board.

     

  9. A few mysteries remain in the ALU/register board. The three registers probably act as an accumulator, a temporary register, and an extra register for multiplication/division, but it's not clear which register is which. I don't understand why the inputs are organized as they are; for instance, you can't add register 1 to register 2 shifted. The mix input seems very random; maybe these signals are part of a self test? On the board, I expected to see 12 bits out of a uniform 32-bit ALU. However, the top two 4-bit "nibbles" have different control lines and different zero-detection from the third. Perhaps this is because the Mitra floating-point numbers have 24 bits of mantissa and 8 bits of exponent. It would make sense for the ALU/register board to handle these parts separately. Another mystery is that the board has a circuit to test two hardwired bits and two external bits to see if they are all 0 or all 1, for some reason. 

  10. The multiplexer chips are dual 4-to-1 multiplexers. Thus, two multiplexer chips are required to support four bits. 

  11. The chips in the Spacelab computer use a variety of part number systems. A few chips have standard industry part numbers such as "SNJ5483" (equivalent to a 7483 adder). Most of the chips are labeled with military part numbers such as JM38510/07801 BJB, using the MIL-M-38510 standard. These part numbers can be cross-referenced using the MIL-HDBK-983 handbook. Other chips, like the ones below, have Fairchild part numbers that are a mystery to me. The first line is presumably the part number, "929 567" and "929 705", but I can't find these numbers anywhere. If you know what these numbers mean, please let me know! (07263 is the CAGE code for Fairchild, and the last line is the date code.)

    Two Fairchild ICs with mysterious part numbers.

    Two Fairchild ICs with mysterious part numbers.

    The ALU/register board that I examined uses the following JM38510 part numbers, which I have converted to standard parts:
    /01403 = 54153 dual 4-1 multiplexer
    /07003 = 54S04 hex inverter
    /07006 = 54S20 4-input NAND
    /07601 = 54S194 4-bit shift register
    /07801 = 54S1814-bit ALU
    /30107 = 54LS175 quad flip-flop 

  12. The photo below compares an IBM board (top) with a Spacelab board (bottom), both from the early 1980s. It's interesting how similar the boards are. Both use a 0.1" grid of holes, unlike most printed-circuit boards, which only use holes where needed. Both boards are multi-layer with integrated circuits on one side. The IBM board is denser; the chips are spaced 0.1" apart rather than 0.3" apart.

    An IBM computer board (top) and a board from the Spacelab computer (bottom).

    An IBM computer board (top) and a board from the Spacelab computer (bottom).

    I don't know which IBM system used this board, but it was a commercial system, not an aerospace system. This board is a bit unusual for IBM, since most of the chips are standard DIPs rather than the square metal cans that IBM typically used. 

  13. The US blocked computer exports to France with NSAM 294, a 1964 National Security Action Memorandum. The US later allowed sales of the CDC 6600 and IBM 360/91 computers to France on the condition that France not use the computers for atomic weapon development, a condition that France apparently violated. See A.E.C. Bids Industry Avoid Sales Aiding French Tests (1964) and Paris Promises Not to Use Equipment for Atomic Weapons (1966). The CDC 6600 supercomputer executed up to 10 million instructions per second (MIPS) while the IBM 360/91 executed about 17 MIPS. (In comparison, a 1995 Pentium Pro or a 2012 cell phone is faster than these computers.) In 1971, Henry Kissinger was still blocking computer exports to France, as shown in this transcript. (One confusing issue in these articles is that IBM announced the 360/92 computer in 1964, but renamed it as the 360/91 before it shipped in 1967.) 

  14. Some contemporary articles on Plan Calcul are France Entering Computer Battle: Starts All-French Company to Compete (New York Times, 1967) and France: First the Bomb, Then the "Plan Calcul" (Science, 1967). See History of Computing in France: A Brief Sketch for an overview of the French computer industry. 

  15. Thomson has a complicated history. In 1883, two Americans, Thomson and Houston, started the Thomson-Houston Electric Company. A decade later, this company became General Electric, with a French subsidiary: Thomson Houston International. After various mergers, the French subsidiary became Thomson-CSF, a major defense and electronics firm.

    In a sense, Thomson-Houston both created and destroyed GE. The Thomson-Houston Electrical Company became GE, but the French subsidiary of Thomson-Houston ended up being a key part of GE's collapse almost a century later. Specifically, the French rail transport company Alsthom (later Alstom) was formed from the French heavy engineering subsidiary of Thomson-Hudson in 1928; the "thom" in "Alsthom" comes from "Thomson". In 2014, General Electric acquired Alstom for $10.1 billion. The acquisition was a disaster, and in 2018, GE wrote off $23 billion. This loss, along with other financial problems, led to GE's announcement in 2021 that it would break up into three companies. 

  16. One more company should be mentioned: MATRA. MATRA was the contractor for Spacelab's data systems, so the Spacelab computer was produced under a contract from MATRA. People often confuse Mitra (the name of the computer line) with MATRA. 

  17. Due to financial difficulties, Bull was acquired by General Electric in 1964, then was acquired by Honeywell, nationalized by France, partnered with NEC, acquired Zenith, privatized by France, and acquired by Atos. Less than two months ago, France acquired Bull, continuing the series of reorganizations. 

The electromechanical angle computer inside the B-52 bomber's star tracker

Before GPS, how did aircraft navigate? One important technique was celestial navigation: navigating from the positions of the stars, planets, or the sun. While celestial navigation is accurate, cannot be jammed, and doesn't require any broadcast infrastructure, it is a difficult and time-consuming process to perform manually. In the early 1960s, an automated system was developed for the B-52 bomber to automatically track stars and compute navigation information. Digital computers weren't suitable at the time, so the star tracking system performed trigonometric calculations with an electromechanical analog computer called the Angle Computer.1

The Angle Computer contains complex electromechanical systems. Click this image (or any other) for a larger image.

The Angle Computer contains complex electromechanical systems. Click this image (or any other) for a larger image.

The photo above shows the mechanism inside the Angle Computer.2 Although it may look like a gyroscope or IMU (Inertial Measurement Unit), it is completely different and nothing is spinning. The Angle Computer physically models the "celestial sphere", with a complicated mechanism inside that moves a pointer that represents the position of a star. The corresponding angles (the azimuth and altitude) are read out electrically through devices called synchros, providing information to the navigation system through bundles of wires. In this article, I'll give an overview of how celestial navigation works and explain how the Angle Computer performs its calculations.

The Astro Compass system

The Angle Computer is one piece of the Astro Compass, a system that locked onto a star and produced a highly accurate heading (i.e., compass direction), accurate to a tenth of a degree. While the heading is the main output from the Astro Compass, the navigator can also use it to determine position, using the "lines of position" technique described later.

The Astro Tracker was mounted on top of the aircraft with the plastic bubble sticking out.

The Astro Tracker was mounted on top of the aircraft with the plastic bubble sticking out.

The Astro Compass navigation system was built around the "Astro Tracker" (above), the optical system that tracks a star. The Astro Tracker was mounted on the aircraft with the 4-inch glass dome protruding from the top of the fuselage. This unit contains a tracking telescope, which used a photomultiplier tube to detect the light from a star. A gyroscope and a complicated system of motors provided a "stable platform", keeping the telescope precisely vertical even as the aircraft tilted and moved. A prism rotated and tilted to aim the telescope at a particular star.3

Star tracker instruments in the B-52 navigator's instrument panel: Line of Position display, Master Control panel, Heading Display panel, and Indicator Display panel.  From Kollsman MD-1 Automatic Astro Compass Manual.

Star tracker instruments in the B-52 navigator's instrument panel: Line of Position display, Master Control panel, Heading Display panel, and Indicator Display panel. From Kollsman MD-1 Automatic Astro Compass Manual.

The Astro Compass system is bewilderingly complicated, consisting of 19 components (above) to support the Astro Tracker.4 On the right are the ten amplifier and computer components that controlled the system; the Angle Computer is in the lower right. On the left are the nine control and indicator panels that were used by the B-52's navigator. The photo below shows four of these panels in use in a B-52 in 1972.

The navigator's station in a B-52. Some of the Astro Compass controls are indicated with arrows: the Line of Position display and the Master Control on the left, and the Heading display and Indicator display to the right. The navigator in this photo is Carl Hanson-Carnethon. From Rob Bogash's B-52 photo album. This specific B-52 (#2584) is now at The Museum of Flight, Seattle, but the Astro Compass is no longer present.

The navigator's station in a B-52. Some of the Astro Compass controls are indicated with arrows: the Line of Position display and the Master Control on the left, and the Heading display and Indicator display to the right. The navigator in this photo is Carl Hanson-Carnethon. From Rob Bogash's B-52 photo album. This specific B-52 (#2584) is now at The Museum of Flight, Seattle, but the Astro Compass is no longer present.

Controlling the Astro Compass

The Astro Compass has an interesting user interface, letting you input one value at a time by rotating a knob. First, you use the Master Control Panel to select a data value such as the clock time, SHA (Sidereal Hour Angle) for star #1, or Declination for star #3. Then you turn the "Set Control" knob clockwise or counterclockwise to scroll through the data values until the proper value is reached. Each knob on the Master Control Panel has a different geometrical shape, allowing the user to distinguish the knobs by feel. The Master Control Panel is visible in the lower left corner of the photo above, within easy reach of the navigator.

The Master Control Panel is the main interface to the Astro Compass.

The Master Control Panel is the main interface to the Astro Compass.

Each data value has a separate electromechanical display. The photo below shows a Star Data display, indicating the sidereal hour angle and the declination for a star. I removed the cover so you can see how the digital display actually consists of analog dials rotated by motors under synchro control. The system has three Star Data displays, so it can hold the positions of three stars at a time. Getting fixes from three different stars is useful when computing lines of position. The system uses one star at a time, but you can quickly change stars by flipping the Star switch on the Master Control Panel.

A Star Data display with the cover removed.

A Star Data display with the cover removed.

But how did the navigator obtain the information to put into the Astro Compass, since the sun, moon, stars, and planets are in constant motion?5 The necessary celestial information is published in a book called the Air Almanac. The US Government started publishing the Air Almanac in 1941, issuing a new volume every four months. The Almanac had a sheet for each day, providing celestial data on 10-minute intervals. The first column has the time (GMT, Greenwich Mean Time)6 while the other columns give the position of the sun, an important value called the First Point of Aries (symbol ♈︎), the positions of the visible planets, and the position of the moon. A separate table and chart provided the locations of stars; the stars don't have daily updates since they are almost stationary.7 (The Air Almanac is now online; you can download the 2026 Air Almanac here.)

An excerpt from the 1960 Air Almanac. Photo used with permission from tanasa2022, who is selling the Almanac on eBay.

An excerpt from the 1960 Air Almanac. Photo used with permission from tanasa2022, who is selling the Almanac on eBay.

The navigational triangle: Computing a star's position

The Air Almanac provides star coordinates in a global coordinate system, but the Astro Compass needed to know star coordinates in the aircraft's local coordinate system. Determining the star's position requires changing the coordinate system by using spherical trigonometry and something called the navigational triangle. There's a fair bit of terminology involved, which I'll explain in this section.

The Astro Tracker, like many telescopes, is aimed by using azimuth and altitude. Suppose you go into your yard, point at the horizon, and turn 360° in a circle; the direction you're pointing is called the azimuth. The point directly overhead is called the zenith. Now swing your arm upwards 90° from the horizon to the zenith. That angle is called the altitude. (Confusingly, the term "altitude" is used both for the angle of a star and the height of an aircraft.) Thus, if you point at a particular star, you can describe its position with two angles: your horizontal rotation from north gives the azimuth, and the angle up from the horizon gives the altitude.8 This system is called the horizontal coordinate system, as it is based on the horizon. (The word "horizontal" comes from "horizon", by the way.) This is a local coordinate system since other locations will have a different azimuth and altitude for the star. The azimuth and altitude constantly vary with time because the Earth's rotation makes the star appear to move.

The equations for the altitude and azimuth are complicated, with sines, cosines, arcsine, and arctangent. To see why the equations are complicated, consider a time-exposure photo of star trails. As the Earth rotates, each star forms a circle around Polaris, the North Star. To trace out this circular path, the altitude and azimuth vary in a trigonometric way. This computation is performed electromechanically by the Angle Computer, as will be explained later.

Kitt Peak National Observatory beneath star trail. Credit: DESI Collaboration/DOE/KPNO/NOIRLab/NSF/AURA/L. Tyas, CC BY 4.0.

Kitt Peak National Observatory beneath star trail. Credit: DESI Collaboration/DOE/KPNO/NOIRLab/NSF/AURA/L. Tyas, CC BY 4.0.

Now let's switch to how the position of a star is defined in the Air Almanac (for example), independently of your local position. Pretend that the stars are on the surface of a large sphere that surrounds the Earth, called the celestial sphere. The stars are stationary on the surface of the celestial sphere, while the Earth rotates once a (sidereal)9 day in the middle. Thus, as you look up at the celestial sphere, you see the stars moving. You can extend the Earth's equator out to the celestial sphere, defining the celestial equator. Likewise, the celestial sphere has celestial poles, matching the Earth's poles. On the Earth, you specify a location (such as the airplane's location) with latitude and longitude (red). Latitude is measured from the equator, and longitude is measured from a fixed meridian (orange). The 0° meridian is arbitrarily defined to pass through Greenwich (England, not Connecticut). Similarly, the position of a star is specified by the angle from the celestial equator (called declination instead of latitude) and the angle from the meridian (called the sidereal hour angle or SHA instead of longitude).10

The celestial sphere, with the Earth at the center. The position of a star is described by Sidereal Hour Angle and declination, analogous to longitude and latitude describing the position of, say, an airplane on the Earth. The diagram is based on patent 2998529, "Automatic astrocompass".

The celestial sphere, with the Earth at the center. The position of a star is described by Sidereal Hour Angle and declination, analogous to longitude and latitude describing the position of, say, an airplane on the Earth. The diagram is based on patent 2998529, "Automatic astrocompass".

But what meridian is the starting point—0°—when measuring a star's Sidereal Hour Angle? The celestial equator matches the Earth's equator, but this won't work for the Greenwich meridian because it is constantly in motion. Instead, the 0° celestial meridian is arbitrarily defined as the position where the sun crosses the equator at the vernal equinox (the start of spring). If you consider the position of the sun on the celestial sphere, the sun will travel around the sphere once a year. Because the Earth's axis is tilted, the sun will be above the equator half the year and below the equator half the year, crossing the equator at the vernal equinox (March) and the autumnal equinox (September).

This reference point on the celestial sphere is called the First Point of Aries, represented by the symbol ♈︎ (horns of a ram); you might remember this symbol from the Air Almanac. At this point, the sun is in the constellation Pisces. So why is this point called the First Point of Aries and not Pisces? Back in 130 BCE, the ancient Greek astronomer Hipparchus defined the First Point of Aries as the starting point for the sun's motion. In that distant era, the sun was in the constellation Aries at the equinox, not in Pisces as it is today. It turns out that the direction of the Earth's axis isn't fixed, but moves in a 26,000-year cycle called the precession of the equinoxes.11 A 26,000-year cycle may seem irrelevant, but it's fast enough that the sun has moved from Aries to Pisces since Hipparchus's time. (And the equinox has moved 1° more since the B-52 was first produced!)

(All this talk of Aries and Pisces may sound like astrology, and, yes, there is a direct connection. Aries is the first zodiac sign, starting at the vernal equinox, typically March 21. The equinox's precession is "backwards", so the equinox has moved to Pisces, the last zodiac sign. Astronomically, the equinox will move into the constellation Aquarius around 2600 CE, but astrologers disagree on whether the Age of Aquarius has started; perhaps the 1960s was the dawning of the Age of Aquarius.)

How do you convert the star's fixed coordinate to the Earth's rotating coordinate? First, you look up the angle between the Greenwich meridian and the celestial meridian of Aries at a particular time. This angle (purple) is called the Greenwich Hour Angle of Aries (GHA ♈︎). Next, you look up the star's Sidereal Hour Angle (SHA). Adding them gives you the star's Greenwich Hour Angle (red), the angle between the Greenwich meridian and the star. Subtracting the aircraft's longitude gives you the Local Hour Angle (LHA, not shown), the angle between the aircraft's meridian and the star. (Note that these steps are simply addition and subtraction, so a mechanical system can easily do them with differential gears.)

Computing the Greenwich Hour Angle of the start on the sphere.

Computing the Greenwich Hour Angle of the start on the sphere.

The final step, obtaining the azimuth and altitude, requires tricky spherical trigonometry. The yellow triangle is the navigational triangle, a spherical triangle on the surface of the celestial sphere. The upper vertex is the North Pole, the red vertex is the airplane's zenith (i.e., directly above the airplane), and the final vertex is the star. Two sides of the triangle and an angle (purple) are known, so the remaining angles and sides can be solved with spherical trigonometry. Specifically, the first side (purple) is 90°-declination, the second side is 90°-latitude,12 and the angle between is the LHA (Local Hour Angle). Solving for the angle at the zenith gives the azimuth (blue), while solving for the third side gives 90°-altitude (green, the angle down from the zenith to the star).

By solving the navigational triangle, the altitude and azimuth can be obtained.

By solving the navigational triangle, the altitude and azimuth can be obtained.

Thus, the key problem is solving the navigational triangle. Navigators could solve the navigational triangle by looking up angles in a thick book of "sight reduction" tables and performing some math. But how could the process be automated? That was the purpose of the Angle Computer.

The Angle Computer

The job of the Angle Computer was to solve the navigational triangle mechanically. Its inputs were the star's declination, altitude, and local hour angle. From these, it computed the star's altitude and azimuth at the aircraft's current position.13

The concept behind the Angle Computer is that it physically modeled the celestial sphere with a half-sphere, 2 5/8" in radius. A star pointer was mechanically positioned on the surface of this sphere, using the star's declination and local hour angle, adjusted by the latitude of the viewer. The star pointer moved a readout mechanism that translated the star's position into the azimuth and altitude at the specified location. Thus, the Angle Computer mechanically converted between the coordinate systems by using a physical representation, solving the navigational triangle.

The diagram below shows how the star pointer is positioned on the two-dimensional surface of the sphere, using a complicated mechanism inside the sphere. The U-shaped declination arm swings up and down, corresponding to the star's declination (angle above the celestial equator). Meanwhile, the declination arm constantly rotates around the polar axis, as specified by the LHA (Local Hour Angle). In one (sidereal) day, the mechanism will make a full cycle, corresponding to the Earth's spin. Finally, the latitude arm moves the mechanism up or down, corresponding to the viewer's latitude. On the right, three gears provide the inputs for latitude, LHA, and declination.

The input mechanism for the Angle Computer. The photo has been rotated 90° to better match the
Earth's rotation. Rotation around the polar axis corresponds to the Earth's daily rotation. Note that the star pointer will hit the end of the semicircular azimuth arc at some point; this corresponds to the star moving to the horizon and setting.

The input mechanism for the Angle Computer. The photo has been rotated 90° to better match the Earth's rotation. Rotation around the polar axis corresponds to the Earth's daily rotation. Note that the star pointer will hit the end of the semicircular azimuth arc at some point; this corresponds to the star moving to the horizon and setting.

A separate mechanism provides the altitude and azimuth outputs, driven by the star pointer. The key is the semicircular azimuth arc, which represents the arc from the viewer's horizon to the zenith, oriented to a particular azimuth. The star pointer is attached to the azimuth arc through a slider, so as the star pointer moves, it moves the slider along the azimuth arc and also rotates the azimuth arc. Specifically, the azimuth arc represents the line from the horizon to the zenith at a particular azimuth. The position of the slider on the azimuth arc corresponds to the altitude, from 0° at the horizon to 90° at the zenith.14. The azimuth arc rotates around the zenith point, which is at the back of the azimuth arc; this rotation indicates the azimuth value. As the azimuth arc rotates, it turns a gear at the zenith, providing the azimuth output. The slider arc has teeth on it; as the slider moves, these teeth rotate a second gear, providing the altitude output.

The output mechanism for the Angle Computer. The mechanism is in a different position from the
previous diagram. In particular, the latitude arm has been raised to a near-polar latitude and the photograph is from
the other side of the latitude arm. At this latitude, the polar axis is almost lined up with the zenith. As the LHA changes, the star will move in a circle, rotating the azimuth arc but causing little change in altitude. This corresponds to the real world situation of stars moving in a cirle around the zenith, if you're near the pole.

The output mechanism for the Angle Computer. The mechanism is in a different position from the previous diagram. In particular, the latitude arm has been raised to a near-polar latitude and the photograph is from the other side of the latitude arm. At this latitude, the polar axis is almost lined up with the zenith. As the LHA changes, the star will move in a circle, rotating the azimuth arc but causing little change in altitude. This corresponds to the real world situation of stars moving in a cirle around the zenith, if you're near the pole.

From the back, the numerous synchro transmitters, synchro control transformers, and motors are visible. Even though the computation itself is mechanical, the Angle Computer has numerous electrical components. In the top half, the synchro transmitters provide electrical outputs of the azimuth and altitude. (A synchro transmitter uses fixed and moving coils to convert a shaft rotation angle into a three-wire electrical signal.) The large gear provides the altitude output. In the lower half, the longer cylinders are motors that move the Angle Computer's mechanisms. The motors are directed to rotate to a particular position through a feedback loop: synchro control transformers provide feedback to the external servo amplifiers that power the motors.

The back of the Angle Computer.

The back of the Angle Computer.

Partially disassembling the Angle Computer shows the complex gear trains inside, linking the synchros, motors, and the physical mechanism. The squat brass-colored units in the lower center are differential assemblies to add or subtract signals.15 One of the drive motors, a long cylinder, is visible in the lower right.

Gear trains inside the Angle Computer.

Gear trains inside the Angle Computer.

The Line of Position

Although the heading was the primary output from the Astro Compass, the Astro Compass could also help determine the location of the aircraft, using a technique called the celestial line of position. This technique was discovered in 1837 and became heavily used for navigating ships with a sextant. It could also be used onboard an aircraft.

To understand the line of position, suppose you go outside and find a star directly overhead. If you measure the altitude—the angle from the horizon to the star—with a sextant, the angle will be 90°, since it is overhead. Now, suppose you teleport 60 nautical miles away in any direction. The sextant will now show an altitude of 89° to the star, since a nautical mile is conveniently defined to match one minute of angle (one-sixtieth of a degree). Alternatively, if you measure an altitude of 89° to the star, you know you are 60 miles away from the original point under the star (called the sub-stellar point). Likewise, if you measure 88° to the star, you're on a circle with radius of 120 nautical miles around the sub-stellar point. If you measure, say, an altitude of 40°, you know you're on a very large circle with radius of 3000 miles around the sub-stellar point. So how does this help with navigation?

Suppose you're on a boat in the middle of the Pacific and you have a rough idea of where you are, say within 100 miles, but you want to find your exact position. Put a dot on the map where you think you are. Next, pick a star and work out what the angle to the star should be from your position. Measure the altitude with your sextant. Suppose you expected 50° but measured 51°. You now know that you're somewhere on a circle with radius of 2340 miles around the distant sub-stellar point. This doesn't seem very useful. However, since the angle was 1° more than expected, you know that the circle is 60 miles closer to that distant point than your estimated position. Moreover, since you have some idea of where you are, you know that you're on the part of this circle near your estimated location. And since you're looking at a small part of a big circle, you can approximate it by a line. So you can go back to your map, move 60 miles closer to the star from your estimated point, and draw a perpendicular line. This is your line of position, and you know that you're on this line (more or less).

Knowing that you're on a line isn't too useful, but you can repeat the process with a star in a different part of the sky. Maybe this time the angle is 2° smaller than expected, so you can draw a line of position 120 miles further away from your estimated position, in a different direction. The two lines cross, indicating a position where you (probably) are.16 Normally, you repeat the process with a third star, giving you three lines of position, providing a position and an idea of its accuracy.

The Line of Position display panel. Remember that the altitude here has nothing to do with the aircraft's altitude. From Kollsman MD-1 Automatic Astro Compass Manual.

The Line of Position display panel. Remember that the altitude here has nothing to do with the aircraft's altitude. From Kollsman MD-1 Automatic Astro Compass Manual.

The Astro Compass used the display above to show the star's azimuth and the distance in miles from the assumed location to the line of position, called the Altitude Intercept. With this information, the navigator could draw a line of position on the map. The navigator repeated the process with two more stars to get a location fix.17

Conclusion

The Angle Computer is a relic from a time when a mechanical analog computer was the best way to solve a problem, but the computer was also electrical. Although a mechanical apparatus solved the navigational triangle, it was moved into position by motors, and the output was transmitted electrically through wires. Moreover, the Angle Computer was driven by electronic amplifiers and feedback circuits that used both vacuum tubes and transistors.

The designers of the Astro Compass considered multiple approaches to computing the navigational triangle (details). The first was to use small electromechanical devices called resolvers that convert a physical rotation into sine and cosine values. By combining six resolvers with amplifiers, the altitude and azimuth could be obtained. The resolver solution was rejected as being too large and requiring a precision power supply. The second approach was to use a digital computer to determine the solution. This solution was rejected because in 1963, a digital computer was expensive, slow, and less reliable. The final approach, which was adopted, was to build a mechanical, physical model of the celestial sphere. Thus, the Angle Computer resided at the uneasy intersection of physical mechanisms, electrical circuits, vacuum tubes, and solid-state electronics, soon to be obsoleted by digital computers.

I plan to write more about the Astro Compass system. For updates, follow me on Bluesky (@righto.com), Mastodon (@[email protected]), or RSS. Thanks to Richard for supplying the Astro Compass hardware.

AI statement: I didn't use AI to write this article (details).

Notes and references

  1. The Angle computer is labeled "Computer, Altitude-Azimuth, Automatic Astro Compass Type MD-1" and also has an "MD-3" sticker. Presumably, MD-3 is an upgrade of the MD-1. The system is also known as the "Kollsman KS-50-03 Astro Tracking System" (or maybe 50-08).

    There are a few documents available on the system, including Operating Instructions Handbook, Operating Instructions Pocket Manual, a technical article The Celestial Tracker as an Astro Compass, and a patent Celestial Data Computer. The web page PRC68: Automatic Astro Compass Type MD-1 has an extensive collection of links. CuriousMarc has a YouTube series on the Astro Tracker, starting with part 1. If you want to learn more about celestial navigation, this World War II training film describes the process in detail. 

  2. From the outside, the Angle Computer is an uninteresting black cylinder with connectors on the end. The cylinder was sealed with a soldered metal band that we removed with a blowtorch. It was pressurized with dry nitrogen through the fill valve in the center, a Schrader valve just like you'd find on a tire.

    The Angle Computer is packaged in a nondescript black cylinder.

    The Angle Computer is packaged in a nondescript black cylinder.

     

  3. The Astro Compass needed to know approximately where in the sky to find the star, in order to point its sensor in the right direction. The direction didn't need to be exact because the Astro Compass performed a spiral search pattern to find the star. This search pattern covered ±4° in bearing and ±2.5° in altitude. In comparison, the Moon is 0.5° wide, so it's a fairly large target area. 

  4. The diagram below shows the physical connections of the components of the Astro Compass.

    A physical diagram of the Astro Compass. The Angle Computer is called the Alt Az Computer in this diagram. Click this image (or any other) for a larger version.

    A physical diagram of the Astro Compass. The Angle Computer is called the Alt Az Computer in this diagram. Click this image (or any other) for a larger version.

    For a slightly different perspective, the diagram below shows the flow of data in the Astro Compass.

    A block diagram of the Astro Compass. The Angle Computer is called the Altitude Azimuth Computer in this diagram. From Automatic Astro Compass, Operating Instructions Handbook

    A block diagram of the Astro Compass. The Angle Computer is called the Altitude Azimuth Computer in this diagram. From Automatic Astro Compass, Operating Instructions Handbook

     

  5. The Astro Compass normally gets the latitude and longitude from the bombing computer. It normally gets the approximate heading (called the BATH, Best Available True Heading) from the magnetic compass. These values can all be entered manually if necessary. 

  6. Greenwich Mean Time is now mostly obsolete, replaced by UTC (Coordinated Universal Time). Greenwich Mean Time is based on when the sun reaches its highest point over Greenwich, England (longitude 0°). In solar time, the sun reaches its highest point at exactly noon. Unfortunately, the Earth's orbit is elliptical, so the length of a solar day varies throughout the year, by almost a minute. Since it's nice to have a constant 24-hour day, Mean Time was introduced. The idea is to average out the length of the day throughout the year, so each day is exactly 24 hours, even though the sun is no longer overhead exactly at noon. UTC is essentially the same as GMT, but defined by atomic clocks rather than the position of the sun over Greenwich. They can vary by up to 0.9 seconds, with a leap second added to UTC to keep them in sync. 

  7. The stars are all moving in different directions, but for most stars, the visible change in position (the proper motion) is very small. However, comparing the 1960 Air Almanac with the 2026 Air Almanac shows many of the listed stars have moved a degree or more due to the precession of the equinox. The change varies from star to star, both because the angular change depends on the star's location and because the SHA is exaggerated as you get closer to the poles (details). 

  8. Note that the azimuth is discontinuous at the zenith. To see this, imagine a star passing directly overhead: point your arm at the horizon and then swing it up until it is pointing straight up. To continue, you need to instantaneously spin around 180° and then lower your arm.

    The discontinuity in azimuth is important for the Angle Tracker, since it can't instantaneously change the azimuth by 180°. To avoid this problem, the Angle Computer has cams and microswitches to keep the altitude below 85°. (Otherwise, the azimuth arc will jam up instead of rotating smoothly.) The Astro Tracker also has declination limits of +90° and -47° and a lower altitude limit of -6°. The latitude is limited to the range between -2° and +90°; the system automatically switches hemispheres so both the North and South latitudes are usable. 

  9. One annoyance is that the length of a day is slightly different if you look at the sun (a solar day) versus looking at the stars (a sidereal day). A solar day is the standard 24-hour day, where the Earth rotates once and the sun returns to its previous position (approximately). But if you look at the stars, it takes a bit less time (23 hours, 56 minutes, and 4 seconds) for the stars to return to their previous position. The problem is that during one year, the Earth swings from one side of the sun to the other side and then back to the first side. From the perspective of the stars, this is an "extra" revolution, so there are 366.25 sidereal days in a year, compared to 365.25 solar days in a year. (I.e., it's an "off-by-one" error.) This makes each sidereal day slightly shorter. You can also think of this as the sun moving around the celestial sphere once per year, with the sun's position against the stars constantly changing. 

  10. Celestial navigation usually uses the sidereal hour angle (SHA) to measure the star's position relative to the meridian. Astronomers often use the right ascension instead. The right ascension is measured in the opposite direction and is measured in hours instead of degrees. They are related by the formula RA = (360° - SHA) / 15°

  11. The Earth's axis also wobbles on a cycle of 18.6 years because the Earth isn't exactly spherical. For many purposes, this wobble is averaged out and the "mean equinox" is used. The physical equinox is called the "apparent equinox". Greenwich Mean Sidereal Time (GMST) is measured with respect to the mean equinox, while Greenwich Apparent Sidereal Time (GAST) is measured with respect to the apparent equinox. The difference between the mean equinox and the apparent equinox is called the "equation of the equinoxes". The difference between the two equinoxes is small, less than about 1.1 seconds. 

  12. The angle of 90°-declination is sometimes called co-declination, the complement of declination, i.e., the angle down from the pole. Similarly, 90°-latitude is sometimes called co-latitude.

    The triangle can be solved using the spherical law of sines and the spherical law of cosines. An alternative, which makes more sense to me, is to find the answer by applying rotation matrices to change the coordinate system. Details are here, and Wikipedia has a convenient summary. 

  13. It may seem like there is a chicken-and-egg situation with navigation since you need to know your position in order to compute the star's altitude and azimuth, and you need to know the aircraft's heading to know which direction to point the telescope. In fact, you just need to know the approximate latitude, longitude, and heading (within 4°), and then the system generates a more accurate latitude, longitude, and heading. The process can be repeated until the values converge.

    Moreover, the Astro Compass is just one of the instruments that the navigator uses. The magnetic compass can provide an approximate heading, and dead reckoning or inertial navigation can provide an approximate location. The Astro Compass can use these to generate more accurate information, which in turn can improve the accuracy of the dead reckoning or inertial navigation. 

  14. Since the azimuth arc is a semicircle (180°), it might seem that the star pointer could move 180° in altitude along the azimuth arc. This wouldn't make sense, since the altitude ranges from 0° (horizon) to 90° (zenith). The explanation is that the slider is a quarter-circle (90°). Thus, the star position can only move 90° before the other end of the slider hits the end of the azimuth arc. 

  15. The differential gears are necessary because the axes aren't mechanically independent. For instance, as the latitude arm swings up and down, it also moves the declination and LHA drive shafts, causing unwanted rotation along these axes. The differentials subtract out the latitude motion from the declination and LHA inputs, so the resulting movements on each axis are independent. 

  16. Technically, two different circles on a sphere can cross at 0, 1, or 2 points. In practice, there will be two intersections, but one intersection is very far away and can be ignored. 

  17. Several factors complicated the navigator's job. By the time the navigator completed a measurement, the aircraft could have moved dozens of miles, so the navigator needed to adjust the lines of position based on this movement. But the navigator didn't know exactly how much the aircraft had moved, due to wind and other factors. Thus, even with the Astro Compass, the navigator needed to deal with uncertainty, cross-checking between different measurements to try to get the best results despite constant sources of error.