07-07-2006 03:42 PM
07-08-2006 03:06 PM
07-08-2006 03:35 PM
TonP wrote: Hello jdam, this looks like a IEEE 64-bit binary.
No, DBL has 11 bits in the exponent, not just 8. (SGL has an 8 bit exponent, but is only 32 bits long).
It should not be too hard to implement this conversion using some masking, shifting and bit twiddling. Unfortunately, you loose 3 bits worth of resolution in the mantissa going to DBL, so you would need to go to EXT.
07-10-2006 10:03 AM
Altenbach,
Thank you for the input and congrats on surpassing the 4k mark. Easy to see why!
Fortunately this problem comes with an example that I can use to test out my vi.
The example is as follows.
Example: The number -5.25 represented in DBL
Sign Exponent (8 bits) Mantissa (55 bits)
1 10000011 0101000000000000000000000000000000000000000000000000000
Exp = 10000011 = 131 dec = 131-128 = 3
Mantissa = -(2^-1 (hidden) + 2^-3 + 2^-5) = - (0.5 + 0.125 + 0.03125) = -0.65625
Decimal equiv = -0.65625 x 2^3 = -5.25
Your wisdomm is always appreciated.
07-24-2006 10:56 AM
Altenbach,
Can you share some our your vast wisdom concerning binary data manipulation?
I'm still working the Satellite data messages and I've come across this problem.
Three (3) unsigned 16 bit words comprise the following three variables Mo (24 bits), af0 (11 bits) and af1 (11 bits)
Word 1 - Mo (Part A) Word 2 - Mo (Part B), af0 (Part A) Word 3 - af1, af0 (Part B)
(Mo) Snnnnnnnnnnnnnnn + (Mo) nnnnnnnn (af0) Snnnnnnn (af1) Snnnnnnnnnn (af0) nnn
(last two bits of word 3 are set to logic 0 and not used)
Mo (LSB -23, MSB -1) resolution = 1.1921E-07
af0 (LSB -20, MSB -11) resolution = 9.536743E-07
af1 (LSB -38, MSB -29) resolution 3.637979E-12
Is there a way to manipulate the bits and use scaling to solve this problem? I'm having difficulty.
What would you suggest?