Looking For Pi In The 8087 Math Coprocessor Chip

Even with ten fingers to work with, math can be hard. Microprocessors, with the silicon equivalent of just two fingers, can have an even harder time with calculations, often taking multiple machine cycles to figure out something as simple as pi. And so 40 years ago, Intel decided to give its fledgling microprocessors a break by introducing the 8087 floating-point coprocessor.

If you’ve ever wondered what was going on inside the 8087, wonder no more. [Ken Shirriff] has decapped an 8087 to reveal its inner structure, which turns out to be closely related to its function. After a quick tour of the general layout of the die, including locating the microcode engine and ROM, and a quick review of the NMOS architecture of the four-decade-old technology, [Ken] dug into the meat of the coprocessor and the reason it could speed up certain floating-point calculations by up to 100-fold. A generous portion of the complex die is devoted to a ROM that does nothing but store constants needed for its calculation algorithms. By carefully examining the pattern of NMOS transistors in the ROM area and making some educated guesses, he was able to see the binary representation of constants such as pi and the square root of two. There’s also an extensive series of arctangent and log2 constants, used for the CORDIC algorithm, which reduces otherwise complex transcendental calculations to a few quick and easy bitwise shifts and adds.

[Ken] has popped the hood on a lot of chips before, finding butterflies in an op-amp and reverse-engineering a Sinclair scientific calculator. But there’s something about seeing constants hard-coded in silicon that really fascinates us.

How The 8087 Coprocessor Got Its Bias

Most of us have been there. You build a device but realize you need two or more voltages. You could hook up multiple power supplies but that can be inconvenient and just not elegant. Alternatively, you can do something in the device itself to create the extra voltages starting with just one. When [Ken Shirriff] decapped an 8087 coprocessor to begin exploring it, he found it had that very problem. It needed: +5 V, a ground, and an additional -5 V.

His exploration starts with a smoking gun. After decapping the chip and counting out all the bond wires going to the various pads, he saw there was one too many. It wasn’t hard to see that the extra wire went to the chip’s substrate itself. This was for providing a negative bias to the substrate, something done in some high-performance chips to get increased speed, a more predictable transistor threshold voltage, and to reduce leakage current. Examining where the bond wire went to in the circuitry he found the two charge pump circuits shown in the banner image. Those worked in alternating fashion to supply a -5 V bias to the substrate, or rather around -3 V when you take into account voltage drops. Of course, he also explains the circuits and dives in deeper, including showing how the oscillations are provided to make the charge pumps work.

If this is anything like [Ken’s] previous explorations, it’ll be the first of a series of posts exploring the 8087. At least that’s what we hope given how he’d previously delighted us with a reverse engineering of the 76477 sound effects chip used in Space Invaders and then went deeper to talk about integrated injection logic (I2L) as used in parts of the chip.