Pentium FDIV bug


The Pentium FDIV bug is a hardware bug affecting the floating point unit of the early Intel Pentium processors. Because of the bug, the processor might return incorrect binary floating point results when dividing a number. The bug was discovered in 1994 by Professor Thomas R. Nicely at Lynchburg College. Intel attributed the error to missing entries in the lookup table used by the floating-point division circuitry.
The severity of the FDIV bug is debated. Though rarely encountered by most users, both the flaw and Intel's initial handling of the matter were heavily criticized by the tech community.
In December 1994, Intel recalled the defective processors. In January 1995, Intel announced "a pre-tax charge of $475 million against earnings, ostensibly the total cost associated with replacement of the flawed processors."

Description

The Sweeney, Robertson, and Tocher division algorithm is used on the affected Pentium chips. It is implemented as a programmable logic array with 2,048 cells, of which 1,066 cells should have been populated with one of five values:. On the buggy chips, five cells that should have contained the value +2 were missing, instead returning 0.

Chronology

Thomas Nicely, a professor of mathematics at Lynchburg College, had written code to enumerate primes, twin primes, prime triplets, and prime quadruplets. Nicely noticed some inconsistencies in the calculations on June 13, 1994, shortly after adding a Pentium system to his group of computers, but was unable to eliminate other factors until October 19, 1994. On October 24, 1994, he reported the issue to Intel. According to Nicely, his contact person at Intel later admitted that Intel had been aware of the problem since May 1994, when the flaw was discovered by Tom Kraljevic, a Purdue University co-op student working for Intel in Hillsboro, Oregon, during testing of the FPU for its new P6 core, first used in the Pentium Pro.
On October 30, 1994, Nicely sent an email describing the error he had discovered in the Pentium floating point unit to various contacts, requesting reports of testing for the flaw on 486-DX4s, Pentiums and Pentium clones.
This flaw in the Pentium FPU was quickly verified by other people around the Internet, and became known as the Pentium FDIV bug. One example was found where the division result returned by the Pentium was off by about 61 parts per million.
The story first appeared in the press on November 7, 1994, in an article in Electronic Engineering Times, "Intel fixes a Pentium FPU glitch" by Alexander Wolfe.
The story was subsequently picked up by CNN in a segment aired on November 21, 1994. This brought it into widespread public prominence.
Publicly, Intel acknowledged the floating-point flaw, but claimed that it was not serious and would not affect most users. Intel offered to replace processors to users who could prove that they were affected. However, although most independent estimates found the bug to be of little importance and would have negligible effect on most users, it caused a great public outcry. Companies like IBM joined the condemnation.
On December 20, 1994, Intel offered to replace all flawed Pentium processors on the basis of request, in response to mounting public pressure. Although it turned out that only a small fraction of Pentium owners bothered to get their chips replaced, the financial impact on the company was significant. On January 17, 1995, Intel announced "a pre-tax charge of $475 million against earnings, ostensibly the total cost associated with replacement of the flawed processors." Some of the defective chips were later turned into key rings by Intel.
A 1995 article in Science describes the value of number theory problems in discovering computer bugs and gives the mathematical background and history of Brun's constant, the problem Nicely was working on when he discovered the bug.

Affected models

This problem occurs only on some models of the original Pentium processor. The bug only existed in some Pentium family processors with a clock speed of less than 120 MHz. On affected models, the Intel Processor Frequency ID Utility checks for the presence of this bug.
The ten affected processors are listed below. The 39 S-specs of those processors are not listed in the Intel processor specification finder web page.
FamilyModelSteppingCore steppingClock rateFSB speedS-spec
513B160 MHz60 MHzQ0352, Q0412, SX753
513B166 MHz66 MHzQ0353, Q0413, SX754
515C160 MHz60 MHzQ0466, SX835, SZ949
515C166 MHz66 MHzQ0467, SX837, SZ950

Some Intel 80486 OverDrive and Pentium Overdrive models have also been known to exhibit the FDIV bug, as well as the F00F bug.

Detection methods

Generic

The presence of the bug can be checked manually by performing the following calculation in any application that uses native floating point numbers, including the Windows Calculator or Microsoft Excel in Windows 95/98.
The correct value is:
When converted to the hexadecimal value used by the processor, 4,195,835 = 0x4005FB and 3,145,727 = 0x2FFFFF. The '5' in 0x4005FB triggers the fault in the FPU control logic. As a result, the value returned by a flawed Pentium processor in certain situations is incorrect at or beyond four digits:

Windows 95 or 98

Users can check if their processor has the issue using Device Manager. Once in Device Manager, users should expand "System devices", locate then click on "Numeric data processor", then click the Properties button. Once the new Properties window appears, click the Settings tab.
If the processor does not have the FDIV issue, the following message will be seen:
"Your computer's numeric data processor has passed all diagnostic tests and appears to be working properly.",
Otherwise the following message shall appear:
"The numeric processor in this computer can sometimes compute inaccurate results when dividing large numbers"
Options are then provided at the bottom of the Settings tab to "Always use", "Use only if passes all diagnostics" or "Never use".

Windows NT, 2000, XP, Server 2003

Users can run the pentnt command included with Windows NT 3.51, NT 4.0, 2000, XP, and Server 2003. The computer needs to be restarted for changes to take effect. The pentnt utility is deprecated and not included in current versions of Windows.
The command-syntax is:
pentnt