General Tech

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

The IEEE 1076-2008 and 1076-2019 VHDL floating-point package, specifically the float_pkg, has a bug that causes it to return sqrt(2.0) one unit in the last place too low in double precision by default. The bug was discovered through a testbench that treats operands as exact fractions and runs exact operations, rounding only once before comparing. The testbench found that the package returns incorrect results for 1,271,619 out of 8,692,326 calls, and the issue affects both GHDL and NVC implementations.

Read the full article at github.com →