Altera_Forum
Honored Contributor
13 years agoSingle Precision Floating Point
Hi All,
I'm trying to outsource an equation using floating point variables to another system block within my design. In my Nios code, the two variables (say, x and y) are defined as floats, which are sent out to individual ALTFP_SQRT blocks. The SQRT blocks take single precision binary values as inputs, which are in the IEEE 754 format of Sign,Exponent,Mantissa. Now by defining the values as floats, I assumed that this would be the format that the binary output from Nios would take, but when checking it with SignalTap, it would seem that it's just putting them out as 32-bit straight binary. What's the best way to get around this? Is there a simple definition I'm missing, or is it something more complex? I've enabled the floating point custom instruction in Nios, but that doesn't seem to make any difference, and due to the size constraints within my design, I can't use the CONVERT Megafunctions to switch from straight binary to single precision. Any ideas? Thanks