Inside Intel 8087 Floating-Point Microcode

How Intel's 8087 chip handles floating-point addition and subtraction through microcode.

15 cards · 2m · tap to begin

From · · 2m

Inside Intel 8087 Floating-Point Microcode

How Intel's 8087 chip handles floating-point addition and subtraction through microcode.

In brief

How Intel's 8087 chip handles floating-point addition and subtraction through microcode. The 8087 chip uses specialized microcode to perform floating-point addition and subtraction with special cases for infinities and zeros. Originally reported by Righto.

Intel 8087 Chip Introduction

A close-up of the 8087's datapath, showing functional blocks that are used for addition and subtraction. Click this image (or any other) for a larger version.

In 1980, Intel introduced the 8087, a chip that made floating-point operations much faster in IBM PC and other systems.

8087 Microcode Focus

Flowchart of the common microcode for basic arithmetic operations. (Click for a larger image.)

The article examines the 8087's microcode and circuitry for floating-point addition and subtraction, including special cases for infinities and other values.

8087 Data Format

The circuitry to detect 0 to 7 leading zero bits. The same approach is used to detect leading zero bytes.

The 8087 stores numbers in an 80-bit format called temporary real with a sign bit, 15-bit exponent, and 64-bit significand.

Floating-Point Basics

Floating-point numbers use a sign, significand, and exponent to represent fractional values over an enormous range.

Addition Process

Before adding, the binary points must be aligned by shifting values to match exponents, then the significands are added.

Subtraction Process

Subtraction requires aligning binary points, subtracting significands, and normalizing the result with potential sign changes.

Microcode Implementation

Flowchart of the add/sub microcode.

The 8087 implements addition and subtraction through microcode that handles zero cases, exponent comparisons, and normalization.

Special Cases Handling

The 8087 handles special cases including infinities, zeros, Not-a-Number, and denormals with specific microcode paths.

Leading Zero Circuitry

The 8087 uses a two-step process to count leading zeros for shifting values during subtraction and addition.

Exponent Adjustment

The 8087 tracks exponent adjustments through a two-bit register and temporary registers to handle overflow and underflow.

Special Value Handling

The 8087 has specific paths for handling positive and negative zeros, infinities, and Not-a-Number with different rounding rules.

Microcode Complexity

The 8087's microcode includes 18 conditional branches to handle special cases and ensure correct floating-point results.

8087 Legacy

The 8087 led to the IEEE-754 floating-point standard used in modern computing despite some features being dropped from the standard.

Author Background

The author reverse-engineered the 8087 microcode with the Opcode Collective, especially Smartest Blob and Gloriouscow.

Further Resources

The 8087 repository on GitHub provides more details on the microcode and implementation.

The one thing

The 8087 chip uses specialized microcode to perform floating-point addition and subtraction with special cases for infinities and zeros.

Read the original on Righto

React

Sign in to react and comment.

Comments (0)

Life is short. Keep it sweet. Respect others' opinions and be kind!

    Recommended next

    More decks on intel and related topics.