05-12-2014 01:54 AM
Hi,
I'm using sbRIO 9636 to generate a sine wave with an amplitude of 1V. The divide function in my FPGA VI seems have some problem.
For example, if I divide 1 with 1, the answer is 1 when I chose integer output type. But when I chose single floating point output type, the answer is 1.07E9. I found this is 2^32, but don't know why and how to fix it.
Thanks,
Jiaqi
05-12-2014 07:34 PM
I think the problem may due to the floating point calculation in FPGA.
If I do need floating point calculation in FPGA, can I add a time delay in the loop to guarantee that there's enough time to do this?
05-13-2014 02:47 PM
Hi jwan887,
I haven't seen the same behavior myself on the FPGA, when simply testing all single floats and a divide function inside a while loop, with no other processing in the background on a similar sbRIO.
You shouldn't need to change the loop timing, as single floats aren't usable in single-cycle timed loops, and in a regular while loop the code should throw a compile error if the timing isn't met.
Could you post a screenshot of the relevant section of your code? I'd like to see what else is going on that could cause this issue.
05-13-2014 02:56 PM
It may also be useful to list the versions of your software you notice this in.