From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rounding in DMA FIFO

The data coming out of the DMA FIFO is being rounded and I can't figure out why. The vi's shown here are simply sending an array into the FPGA from the host and then back to the host. When it arrives back at the host the data has been rounded down. I'm assuming some truncation is happening? Anyone have any idea how I can fix this? I'm new to this so any suggestions would be very much appreciated. 

Download All
0 Kudos
Message 1 of 8
(3,121 Views)

What is the datatype for your FIFO?

 

My guess is that it is an integer.  See if you can define another datatype to it.  Though you should try to stick with integers or fixed point numbers on an FPGA.  They take up a lot fewer resources on an FPGA than floating point numbers.

0 Kudos
Message 2 of 8
(3,092 Views)

The data type is an I16. 

 

So do you suggest that I convert all these decimals into integers by multiplying by a large number going in and divide by the same number coming out? Or is there a better method? 

0 Kudos
Message 3 of 8
(3,080 Views)
It's clear that the FIFO data type is an integer type, as RavensFan mentions.

If you're simply transferring numbers around, there's no difference in resource use between a single-precision float and any other 32-bit value. Floating point calculations can be more expensive than fixed point or integer calculations on an FPGA, but recent versions of LabVIEW FPGA have much better support for floating point than earlier versions, and I'd no longer recommend avoiding floating point unless you're running into space or performance limitations.
0 Kudos
Message 4 of 8
(3,078 Views)
You can change the FIFO data type in the FIFO properties, in the project. There's a category called "Data Type" with a drop down list of types.
0 Kudos
Message 5 of 8
(3,071 Views)

Yes, I realize now that the integer type is the problem. 

 

I won't just be transfering numbers around. I was just learning how to use the DMA FIFO. I'll be doing some matrix multiplication and some other basic math functions. Do you still recommend I keep using floating point numbers for that and only switch when I hit performance limitations or run out of space?

0 Kudos
Message 6 of 8
(3,069 Views)

Found it. Thank you.

0 Kudos
Message 7 of 8
(3,065 Views)
Depends a bit on what you're doing. If everything fits on the FPGA and runs fast enough using floating point, then you'll probably find it easier to stick with floating point math.
0 Kudos
Message 8 of 8
(3,061 Views)