LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA - convert FXP to FXP

Solved!
Go to solution

Hi all,

I have a problem on LabVIEW FPGA.
After a High Throughput, the result is in FXP 36,19.
I want to change this result in 18,1.
The convert function make overflow. I only want to keep high value, like shifts 36,19 to 18,1.

Can you help me.

Thanks 

0 Kudos
Message 1 of 4
(3,109 Views)

edit : it's like having U32 and keep upper parts to have U16

0 Kudos
Message 2 of 4
(3,079 Views)
Solution
Accepted by topic author Minikisscool

There are several options.

For full flexibility you can always use number to boolean array, then extract the bits you need (using array subset), then use boolean array to number to convert the bits back to the desired FXP type.

These are all free operations on the FPGA (when wiring constants to the array subset function).

You could also check if "Reinterpret Number" works for you (maybe followed by a To FXP to cut the obsolete bits).

 

0 Kudos
Message 3 of 4
(3,073 Views)

Thanks, I do :

FXP to bollean array
bollean array to Uxx
mask AND or exclusive OR
reinterpret Number

0 Kudos
Message 4 of 4
(3,021 Views)