Email or username:

Password:

Forgot your password?
Ken Shirriff

The Pentium processor had a minor error in the division algorithm. This error cost Intel $475 million to replace the faulty chips. I've tracked down the FDIV error to this circuit on the die:

A closeup of the Pentium die showing complex circuitry. This image shows the middle of three metal layers. The image shows complex horizontal and metal lines, reddish golden in color.
28 comments
Ken Shirriff

@azonenberg The f00f bug is probably in microcode, so here's a random piece of the Pentium's microcode as it appears on the die :-)

A closeup of the Pentium die showing part of the microcode. The image shows horizontal lines with a scattering of squares. The squares are transistors, which result in a 1 bit in that location.
Ken Shirriff

The circuit is a Programmable Logic Array (PLA) holding a lookup table for the floating-point division unit (FDIV). The circuit is a small part of the Pentium chip, visible in the lower right.

A die photo of the Pentium with the main functional blocks labeled. The die is a complex pattern of brownish rectangles. The functional blocks include the caches, instruction fetching and decoding, the integer math unit, and the floating point math unit.
Ken Shirriff

This closeup of the PLA shows the individual transistors that define the contents of the lookup table. Five entries were missing from the table, causing very rare errors in division.

An image of the silicon die with the metal layers removed, showing the silicon and polysilicon regions that form transistors. The image consists of several grids of transistors with complex circuitry in the middle.
penguin42

@kenshirriff Oh great - you found it! Nice! I did have my P90 replaced!

J. Peterson

@kenshirriff If the PLA bits are defined in the long thin structures on the right, I wonder if the missing bits are at the bottom? That section is suspiciously devoid of the various marks the rest of the structure has.

Amazing find!

Ken Shirriff

@isonno Good eye to spot the unused entries at the bottom! Those aren't the missing entries, though. The mathematical table got encoded into Boolean equations, which are stored in the PLA. There is not easy mapping between the table and what you see on the die. In fact, the fixed Pentiums have *fewer* entries in the PLA due to the way the equations work out.

Tommy Thorn

@kenshirriff "Rare" is a bizarre phrasing (clearly one Intel liked to use). It's trivial to reproduce this a few million times a second and indeed, it was original found on a real-world application.

Teknikal_Domain

@kenshirriff As stated by Wikipedia:

In order to improve the speed of floating-point division calculations [...] Intel opted to replace the shift-and-subtract division algorithm with the Sweeney, Robertson, and Tocher (SRT) algorithm. [...] It is implemented using a programmable logic array with 2,048 cells, [...] When the original array for the Pentium was compiled, five values were not correctly sent to the equipment that etches the arrays into the chips – thus five of the array cells contained zero when they should have contained +2.

As a result, calculations that rely on these five cells acquire errors; these errors can accumulate repeatedly owing to the recursive nature of the SRT algorithm.

--

First time I've actually seen pictures of the relevant parts of the die though. Amazing!

@kenshirriff As stated by Wikipedia:

In order to improve the speed of floating-point division calculations [...] Intel opted to replace the shift-and-subtract division algorithm with the Sweeney, Robertson, and Tocher (SRT) algorithm. [...] It is implemented using a programmable logic array with 2,048 cells, [...] When the original array for the Pentium was compiled, five values were not correctly sent to the equipment that etches the arrays into the chips – thus five of the array cells contained...

spmatich :blobcoffee:

@kenshirriff I am Pentium of borg. Division is futile. You will be approximated.

Karl Auerbach

@kenshirriff I remember that! Intel was very snooty about replacements. I got 'em to replace mine by pointing out that I was doing medical calculations that could determine whether a person needed surgery or not.

Tito Swineflu

@kenshirriff Does this mean the chip has hard-coded division results stored on it? Like 8/3 = 2.66666?

Ken Shirriff

@tito_swineflu The lookup table is more complicated than that. The Pentium uses the SRT division algorithm, which does division in base 4, but allows the quotient digits to be -2, -1, 0, 1, or 2. The lookup table determines the quotient digit from the first few bits of the divisor and dividend so you don't need to completely divide. The quotient digit may not be completely accurate, but the negative values let you correct that in the next digit.

thejikz

@kenshirriff several thoughts all at once:

oh duh-doy, there it is!! LoL

That is one fine feckin needle you got there in yer copper silicon haystack!!

This is going to make a killer screen background.

I love our world and that we have done this as a people.

And last, "COOL!!"

Andrew Leer

@kenshirriff I don't want to say that it looks like a breadboard...but.

Play Ball!!! cafechatnoir

@kenshirriff

Is this the one from the 90s?

I was at my first proper grown up job - as an accountant no less - I remember reading about this and going to my boss and telling him we HAD to check all the computers! We did engineering, we HAD to check! (There was some formula you could put into excel to check it.)

He told me to knock myself out and go nuts. I checked all our computers (thankfully we were a tiny company) and I found multiple bad processors.

StephenM

@kenshirriff I am certain that I have seen that very same diagram carved into an inside wall of an Aztec pyramid.

BITNACHT

@kenshirriff Minor as it may be: it was easy to create horribly wrong results and led to the urban slogan “Don't divide! Intel inside.” #pentiumbug

Trouble

@kenshirriff a friend of a friend worked for the company that Intel decided to not hire (again) to prove that their float math unit was correct. I can try to put you in touch if you are interested in the human side of things.

hambier

@kenshirriff Nice. I got that one replaced for free. Different times...

DELETED

@kenshirriff
Free Debt - No Return pay for 1 year & No Interest Also ---- shorturl.at/68CkI

Jordi (Sharpen Your Spikes!!!)

@kenshirriff

At first glance, I thought this was the map screen from the original Pokémon.

4censord :neocat_flag_pan:

@kenshirriff oh that looks like my cuircuit making module in factorio :grin:

Go Up