LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed point math

I have been learning fixed point math for FPGA. 

I have a task to take multiply 2 DBL array inputs by converting them fixed and again convert the fixed point result into floating-point. Addition and Subtraction are getting. But multiplication and division giving wrong results.

can u please check my code and inform me about where I have mistaken?

0 Kudos
Message 1 of 2
(1,192 Views)

Fixed-point is a dedicated LabVIEW datatype, you are just converting to a scaled integer.

If you multiply, you need to account for the fact that the scaling factor is getting squared. (similarly, if you divide, the scale factors will cancel out)

 

If you would use the real fixed-point datatype, the result will be correct automatically.

 

 

 

Message 2 of 2
(1,173 Views)