Greetings. I am trying to extract the real number from the bytes
Bit 15 is a sign bit , zero indicates positive number.
Bits 14 through 7 are excess 128 binary component.
Bits 6 through 0 and 31 through 16 are a normalized 24 -bit fraction with falling sinificance in that order. The most significant bit 6 isworth 1/4.
In the hex code also thay are C7 11 42 3A.
the integer values of individual bytes are -57 17 66 58 .
I wantto extract the real vaue.
-57 in binary ------- 11000111 < bits 31 to 24
17 in binary ------- 00010001 < bits 23 to 16>
66 in binary ------- 01000010 < bits 15 to 8 >
58 in binary ------- 00111010 < bits 7 to 0 >
As per the above format bit 15 is 0. So sign is 0.
exponent is from from 14 to 7 ---- 10000100 = -4 = 132( unsigned int )
so, excess exponent = 4;
and mantissa is
0111010 11000111 00010001 0 = 7.7041e+06
The number is
Sign * 2 ^^( 132-128 )* 1.f.
Where f is float of mantissa.
I am getting 77041 and I expect a value between 10 and 50.
I can code it if I know whether I had understood this correctly.
Bit 15 is a sign bit , zero indicates positive number.
Bits 14 through 7 are excess 128 binary component.
Bits 6 through 0 and 31 through 16 are a normalized 24 -bit fraction with falling sinificance in that order. The most significant bit 6 isworth 1/4.
In the hex code also thay are C7 11 42 3A.
the integer values of individual bytes are -57 17 66 58 .
I wantto extract the real vaue.
-57 in binary ------- 11000111 < bits 31 to 24
17 in binary ------- 00010001 < bits 23 to 16>
66 in binary ------- 01000010 < bits 15 to 8 >
58 in binary ------- 00111010 < bits 7 to 0 >
As per the above format bit 15 is 0. So sign is 0.
exponent is from from 14 to 7 ---- 10000100 = -4 = 132( unsigned int )
so, excess exponent = 4;
and mantissa is
0111010 11000111 00010001 0 = 7.7041e+06
The number is
Sign * 2 ^^( 132-128 )* 1.f.
Where f is float of mantissa.
I am getting 77041 and I expect a value between 10 and 50.
I can code it if I know whether I had understood this correctly.