понедельник, 28 сентября 2026 г.

Reverse-engineering the vintage Intel 8087’s tangent algorithm: more than CORDIC

Ken Shirriff has published another teardown of Intel’s 8087 floating-point coprocessor on righto.com, this time covering the FPTAN tangent instruction. He removed the chip’s lid with a chisel and imaged the die under a microscope, then read the 1648 micro-instructions in the microcode ROM to work out the algorithm.

The 8087 computes a tangent in 90 microseconds, against 13,000 microseconds for emulation on the 8086. It gets there by combining two methods. First it runs 16 CORDIC steps, an algorithm from 1956 that uses only shifts, adds and table lookups. That leaves a tiny residual angle, which the chip handles with a Padé approximant, the ratio 3x/(3-x2). The error is proportional to x to the fourth, so with x under 2^-16 the result meets the 64-bit accuracy requirement.

FPTAN does not return the tangent. It returns X and Y separately, so the division is left to the programmer. The instruction takes about 450 clock cycles typically. The post walks through the microcode, the implicit exponents used for the fixed-point arithmetic, and the 16-bit shift register that stores the CORDIC decision bits.

See much more at righto.com.



from Adafruit Industries – Makers, hackers, artists, designers and engineers! https://ift.tt/H1j4w7K
via IFTTT

Комментариев нет:

Отправить комментарий

Know us

Our Team

Tags

Video of the Day

Contact us

Имя

Электронная почта *

Сообщение *