Die analysis of the 8087 math coprocessor's fast bit shifter
Die analysis of the 8087 math coprocessor's fast bit shifter
Floating-point numbers are very useful for scientific programming, but<br>early microprocessors only supported integers directly.1<br>Although floating-point was common in mainframes back in the 1950s and 1960s,<br>it wasn't until 1980 that<br>Intel introduced the 8087 floating-point coprocessor for microcomputers.2<br>Adding this chip to a microcomputer such as the IBM PC made floating-point operations up to 100 times faster.<br>This was a huge benefit<br>for applications such as AutoCAD, spreadsheets, or flight simulators.3<br>The downside was the 8087 chip cost hundreds of dollars.4
It's hard to implement floating-point operations so they are computed quickly and accurately.<br>Problems can arise from overflow, rounding, transcendental operations, and numerous edge cases.<br>Prior to the 8087, each manufacturer had their own incompatible ad hoc implementation of floating point.<br>Intel, however, enlisted numerical analysis expert William Kahan to design accurate floating point<br>based on rigorous principles.5<br>The result was the floating-point architecture of the 8087. This became the IEEE 754 standard used in almost<br>all modern computers, so I consider the 8087 one of the most influential chips ever designed.
Die of the Intel 8087 floating point unit chip, with main functional blocks labeled. The die is 5mm×6mm. The shifter is outlined in red. Click for a larger image.
To explore how the 8087 works, I opened up an 8087 chip and took photos of the silicon die with a microscope.
Containing 40,000 transistors, the 8087 pushed chip manufacturing to the limit; in comparison, the companion 8086 microprocessor only had 29,000 transistors.<br>To make the chip possible, Intel developed new techniques.<br>In this article, I focus on the high-speed binary shifter (outlined in red above).<br>The shifter takes up a large fraction of the chip's area, so minimizing its area was vital to making the 8087 possible.
A floating-point number consists of a fraction<br>(also called significand or mantissa), an exponent, and a sign bit.<br>(These are expressed in binary, but for a base-10 analogy, the number 6.02×1023 has 6.02 as the fraction and 23 as the exponent.)<br>The circuitry to process the fraction is at the bottom of the die photo.<br>From left to right, the fraction circuitry consists of a constant ROM, a shifter (highlighted), adder/subtracters, and the register stack.<br>The exponent processing circuitry is in the middle of the chip. Above it, the microcode engine and ROM control the chip.
The shifter
The role of the shifter is to shift binary numbers left or right,<br>a task with<br>several critical roles in floating-point operations.<br>When two floating-point numbers are added or subtracted, the numbers must be shifted so the binary points line up.<br>(The binary point is like the decimal point, but for a binary number.)<br>The 8087's transcendental instructions are built around shift and add operations, using an algorithm called CORDIC.<br>The shifter is also used to assemble a floating-point number from 16-bit chunks read from memory.8
Since shifts are so essential to performance, the 8087 uses a "barrel shifter", which can shift a number by any number of bits in a single step.6<br>Intel used a two-stage shifter design that kept its size manageable while still providing high performance.<br>The first stage shifts the value by 0 to 7 bits, while the second stage shifts by 0 to 7 bytes.<br>In combination, the two stages shift a value by any amount from 0 to 63 bits.
The bit shifter
I'll start by describing the bit shifter, which performs a shift of 0 to 7 bit positions.<br>The diagram below outlines the structure of the bit shifter, showing five of the inputs and outputs; the full shifter supports 68 bits.7<br>The concept is that by activating a particular column, the input is shifted by the desired amount.<br>Each circle indicates a transistor that can act as a switch between an input line and an output line. The vertical select lines are used to activate the<br>desired transistors.<br>Each input line is connected diagonally to eight transistors, allowing it to be directed to one of eight outputs.<br>For example, the diagram shows shift select line 3 activated, turning on the associated transistors (green).<br>The highlighted input 20 (orange) is directed to output 23 (blue).<br>Similarly, the other inputs are connected to the corresponding outputs, yielding a shift by 3.<br>By activating a different shift select line, the input will be shifted by a different amount between 0 and 7 bits.
Structure of the bit shifter. By energizing a shift select line, the inputs are connected to outputs with the desired bit shift.
To explain the internal construction of the shifter, I'll start by describing the NMOS transistors used in the 8087 chip.<br>Transistors are built by doping areas of the silicon substrate with impurities to create "diffusion" regions with different electrical properties.<br>The...