Login
You're viewing the discuss.systems public feed.
  • Sep 12, 2026, 4:25 PM

    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...

    The integrated circuit is a black ceramic rectangle with 40 metal pins sticking out, in two rows. (This is known as a DIP, a Dual Inline Package.) It has three rows of text: "D8087-1", a cryptic version label, and then the copyright line with a big lower-case I, INTEL m c 1980 1984. The m and c are in circles for the mask-work symbol and the copyright symbol. The chip has a small semicircular notch on the left side, indicating its orientation. The package consists of two thin ceramic layers, bonded together with a gray substance; the metal pins stick out from this gray substance. The ceramic package is important to me because tapping the gray layer with a chisel will cause the two layers to separate, revealing the silicon die inside. In contrast, most chips are in epoxy packages, which are very difficult to open, usually requiring strong acids.
    💬 6🔄 333⭐ 440

Replies

  • Sep 12, 2026, 4:27 PM

    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.

    A die photo of the 8087 showing the rectangular silicon die, about 5mm × 6mm. The image is dark reddish-brown, with black and white regions. Complex patterns are visible, mostly rectangular regions with various textures. Thick white lines in various regions are metal on top of the chip, carrying power to all parts of the chip. Around the edges of the die, 40 thin back wires are bond wires, connecting the die to the external pins. A few text labels indicate major functional blocks, such as the microcode ROM.
    💬 1🔄 23⭐ 77
  • Sep 12, 2026, 4:28 PM

    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.

    A close-up of the 8087's microcode ROM, showing 77 transistors in a grid, pinkish blobs of doped silicon. A transistor is formed where a vertical polysilicon line crosses a horizontal stripe of doped silicon.
    💬 3🔄 16⭐ 72
  • Sep 12, 2026, 4:29 PM

    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.

    A close-up of the bottom region of the 8087's silicon die. This shows the circuitry that performs arithmetic on 80-bit floating-point numbers. I've highlighted key functional blocks. One large block is the shifter, which can shift the bits of a number left or right by an arbitrary amount. The adder, in the middle, does integer arithmetic; it is the heart of the chip. To the right, registers hold numbers. At this resolution, the different functional blocks have different textures, but the circuitry isn't visible.
    💬 1🔄 12⭐ 68
  • Sep 12, 2026, 4:30 PM

    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.

    A short excerpt of the microcode for FSCALE. It has low-level instructions that look a lot like assembly language such as "jmp #0776 if tmpA:tag ZERO".
    💬 3🔄 10⭐ 71
  • 💬 5🔄 39⭐ 112
  • Sep 12, 2026, 4:31 PM

    Credits: 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.
    7/7

    💬 3🔄 6⭐ 73
  • Sep 12, 2026, 4:40 PM

    @kenshirriff Fascinating project.

    It’s been too long since I worked on x87 microcode to remember anything useful, other than needing … 6? … extra bits of mantissa to be able to newton-raphson all the trig functions to a full 80 bit accuracy with reasonable number of cycles.

    💬 0🔄 1⭐ 16
  • 💬 0🔄 0⭐ 5
  • 💬 0🔄 0⭐ 6
  • Sep 12, 2026, 7:50 PM

    @kenshirriff @gloriouscow
    In the 8086/8087 era I ‘devoured’ those thick tomes produced by Intel that described all the low level stuff. Soon, it just became too complex to follow, at that level, for a mere mortal on the basis of ‘fascination’.
    Bowers Avenue, Santa Clara - when I finally had a trip to ‘Silicon Valley, I made a ‘bee-line’ there!

    💬 0🔄 0⭐ 8
  • 💬 0🔄 0⭐ 1
  • Sep 13, 2026, 4:34 AM

    @kenshirriff Generic question:

    If you have a program that calculates pi to infirnity. Does the 8086 know to pass certain opcodes to the 8087 and wait for it to complete before continuing to next instruction? do both share the same registers?

    💬 1🔄 0⭐ 2
  • Sep 13, 2026, 3:13 PM

    @jfmezei It's complicated. The 8087 more-or-less watches the instruction stream and grabs instructions to execute. The 8086 runs in parallel until it executes a WAIT instruction to sync up. The 8086 and 8087 have independent registers. So how does the 8087 access memory if the address is in an 8086 register? The trick is that the 8086 does a fake access to the memory location and the 8087 grabs the address off the bus.

    💬 1🔄 1⭐ 5
  • 💬 0🔄 0⭐ 1
  • 💬 0🔄 0⭐ 3
  • 💬 0🔄 0⭐ 1
  • 💬 0🔄 0⭐ 3
  • Sep 14, 2026, 3:39 PM

    @kenshirriff

    Wow! I had no idea the 8087 was such a complex beast.

    My exposure to microcode was with the old Gould SEL 32-bit mini-computers I worked with in 1980. They had an add-on 'floating point array processor' from Floating Point Systems (aka a 'vector processor'), which one programmed using pipelined microcode. You loaded one vector (array of samples) as first input, then another one (same) as second input.

    You could do an add, a multiply, a load, and a store in one clock (IIRC), so you had to 'prime the pipe (the instruction pipeline) then run the loop, then 'empty the pipe' to pop the last results out.

    Immense fun for this bright young novice programmer (21yr old-ish), who had been dropped in the deep end with FORTRAN, assembler, and this microcode, and not much more support than a (very good) set of manuals!

    💬 0🔄 0⭐ 2
  • 💬 0🔄 0⭐ 6
  • 💬 0🔄 0⭐ 3
  • Sep 12, 2026, 7:12 PM

    @kenshirriff

    Is this the beginning of true open source hardware? That would be great.

    But what we really need is DIY memory chips. One chip now costs as much as my computer.

    💬 0🔄 0⭐ 3
  • 💬 0🔄 0⭐ 1
  • 💬 0🔄 0⭐ 0
  • 💬 0🔄 0⭐ 1