DigiNews

Tech Watch by Johan Denoyer

← Back to articles

The VHDL standard's float package gets sqrt(2) wrong

Quality: 8/10 Relevance: 9/10

Summary

The article analyzes a bug in the IEEE Std 1076 ieee.float_pkg implementation in VHDL, showing incorrect sqrt(2) results and other edge-case behavior. It documents failing cases across several formats, presents a patch (float_generic_pkg-body.patch) and explained fixes to normalization, rounding, guard bits, and denormals. The piece includes test vectors, performance data, and a process to run and validate the patched package with GHDL and NVC.

🚀 Service construit par Johan Denoyer