LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Convert from a decimal Input to a 12Q4 binary/hex

Solved!
Go to solution

Hello,
I was wondering if there was a simple way to convert a double DBL input to a signed 12Q4 (or 9Q7) binary eg. from -2048 to 2047.9375.

At the moment I have split the number into a fractional and an integer so that I can deal with both the 12 bit signed number and the 4 bit fractional number separately I then tried rounding the fractional part to 4 bits and rounding the integer part to signed 12 bits but have not had success with that.
Does anyone know of an easy way to convert this in labview?

 

Thanks

 

0 Kudos
Message 1 of 2
(1,008 Views)
Solution
Accepted by topic author EthanK99

Look into the fixed-point data type (FXP).

0 Kudos
Message 2 of 2
(998 Views)