Hi group,
I am looking at a record layout that has a floating point field.
The field is four bytes, it is for short data operations known as
format "E" and
uses 32 bits of data from the registers. The field contains
x'43E88000'. This means the x'43' denotes the sign bit and the
characteristic or
exponent. The x'E88000' is the mantissa or fraction (binary '1110
1000 1000'). The exponent is binary '100 0011' (67 decimal). In
order to sup****t
negative characteristics, the assembler increases the exponent by 64
before converting it to binary. The bias is 64 so 67 - 64 = 3 (the
exponent).
So the value is '111.010001000' because we move the radix point three
places to the right. This field contains the Elapsed time, in seconds
which is
binary '111.010001000' which looks like about decimal number 7. This
is where may calculator doesn't keep up with precision. Binary
'11101000' is
decimal 232, but I don't think you can move the radix point around by
two. So binary '111.010001000' is 7 + a bit more. The binary '.
01000100'
enters as binary '1000100' and is decimal 68. But the leading zero
means something on '.010001000'. I could say the number is greater
than 7, but
floating point is known for accuracy and I would be loosing a bit of
accuracy.
Q). How do I figure out my "remainder" (.010001000)?
Another number I have is x'423c0000'. So x'42' is binary '1000010'
or decimal 66. And 66 - 64 = 2. So x'3C' is binary '111100'
adjusted two to
the right is binary '11.11' or about 3 with a remainder of
something? This field is the length of the sample period. The same
header is used for
different record layouts. I see this same field in a different record
displayed as x'43528000'. So my exponent is 3 and my fraction is x
'528000',
or perhaps binary '1010010 10000000 0000 0000'. So Binary '10100101'
is decimal 165, but I never get anywhere converting this number. So
binary
'101.0011' is just greater than 5.
Any tips on this would be appreciated.
Thank you, Dave H.


|