LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I convert 16 bit Binary to ASCII text

Altenbach,

I like your approach

however, The sign bit is -00-,  mantissa is bits -01- thru -11- (11 Bits)  and the exponent is bits -12- thru -15- (4 bits).

For a word input of 3923 (0,00011110101,0011), I get mantissa of 245 (0000000011110101) and exponent of 3 (0011)

My quest is am I wrong in my math?

0 Kudos
Message 21 of 23
(971 Views)

Ah, sorry. I misread your requirements.

If the exponent is 4 bits, you just change the diagram constant that is currently 8 to 16. Voila! Now you get 245 and 3 from 3923.

(Still, you should also specify details how negative numbers are represented. Is the mantissa in 2's complement or direct for negative numbers?)

Message 22 of 23
(963 Views)

Here are the details I have for this problem

The value of this data word represented by this format is given by: (Integer) X (16**Exponent)

Exponent is 2's comp with Max and Min Values of 15 and 0 respectively.

The full scale of this data word is 2.36E+21 with Max and Min values for the integer of 2047 and -2048 repectively.

2047*16^15 = 2.36E+21

Thank you again for showing me the direct route rather than working on the bit level.

 

0 Kudos
Message 23 of 23
(957 Views)