hneemann / Digital

A digital logic designer and circuit simulator.
GNU General Public License v3.0
4.28k stars 435 forks source link

IEEE 754 components #468

Open tux2603 opened 4 years ago

tux2603 commented 4 years ago

One thing that I've found missing for more complicated builds are built in components for IEEE 754 arithmetic operations. It's possible to implement them using existing components, but that takes time and is somewhat error prone. Since VHDL has built in operations for floating point arithmetic, would it be possible to add another set of components to the arithmetic menu for IEEE 754?

hneemann commented 4 years ago

It's easy to implement IEEE 754 operations as Digital builtin components. But what about HDL export? I have never tried to use floating-point arithmetic in an FPGA. Is such code synthesizable? Can you just use the asterisk and the VHDL compiler utilizes floating point hardware? That would be hard to believe but maybe it is possible nowadays?

tux2603 commented 4 years ago

There's a library/module called float_pkg that you import, and then you can just define your vectors as floating points. As far as I've seen, as long as your board supports >= VHDL 2008, it will be synthesizable.