Post

In 1980, Intel introduced the 8087 floating-point coprocessor chip. Plugging this chip into your IBM PC made math 100 times faster, good for CAD and spreadsheets. I opened up the chip to reverse-engineer exactly how it does complicated calculations. Let's take a look inside...

49 reposts224 likes

Under a microscope, you can see the circuitry of the 8087. The 8087 performs its calculations using low-level software called microcode, stored in the large ROM in the middle. Along with the "Opcode Collective", I'm trying to understand the algorithms in the microcode, from addition to arctangents.

Zooming in on the microcode storage ROM, you can see the individual transistors, the pinkish blobs. The 8087 is very unusual, using four transistor sizes, giving it double density: 2 bits per transistor. The Opcode Collective examined all 13184 transistors, revealing the 0s and 1s of the microcode.

Knowing the contents of the 8087's microcode is just the first step; we've been working for months to assign meaning to the 0s and 1s. I've been reverse-engineering the circuitry in the 8087, units such as an adder, shifter, and registers, to understand what the microcode is doing.

I can now explain the microcode for an instruction called FSCALE that scales a number by a power of 2. It sounds simple, but the 8087 has an appalling number of special cases: positive and negative 0, two infinities, four rounding modes, three number sizes, six exceptions... so the code is complex.