| INTRODUCTION:
A 32-bit floating point number is
llll llll llll llll seee eeee ehhh hhhh
where (l31, l30, ..., l16) are low order fraction bits
(s15) is the sign bit
(e14, e13, ..., e7) are exponent bits
(h6, h5, ..., h0) are high order fraction bits
and its value is
(.1hhh hhhh llll llll llll llll) *
(2 ^ (eeee eeee - 1000 0000)) * ((-1) ^ s) {pardon the 2}
** ** ** ** ** ** ** **
E.g.
llll llll llll llll seee eeee ehhh hhhh
1010 1010 1000 0000 0100 1000 0010 1010
is
(.1010 1010 1010 1010 1000 0000) *
(2 ^ (1001 0000 - 1000 0000)) * ((-1) ^ 0)
= (.1010 1010 1010 1010 1) * (1 0000 0000 0000 0000) * (1)
= 1010 1010 1010 1010.1
= 43,690.5 in decimal
** ** ** ** ** ** ** **
NOTATION: let X be a 32-bit configuration, and
F(X) be its value when interpreted as floating point, and
I(X) be its value when interpreted as a nonzero integer, and
E be the value of eeee eeee,
H be the value of hhh hhhh,
L be the value of llll llll llll llll
As above, F(X) =
(2 ^ (-1) + H * (2 ^ (-8)) + L * (2 ^ (-24))
* (2 ^ (E - 128)) * ((-1) ^ s)
= 2 ^ (E - 129) + H * 2 ^ (E - 136) + L * 2 ^ (E - 152),
or its negative.
** ** ** ** ** ** ** **
#### ---- #### If F(X) = I(X), then: #### ---- ####
PARTIAL RESULT #1: 129 <= E <= 159
I(X) is not zero, and I(X) is not -2^31 (E would be zero), so
2^0 <= ABS (I(X)) < 2^31
So
2^0 <= 2^(E-129) < 2^31
So
0 <= E-129 < 31
So
129 <= E <= 159
PARTIAL RESULT #2: x31 (bit 31 of X) is one. So I(X) = F(X) < 0.
If not, then I(X) is positive. Then I(X) is
1hhh hhhh llll llll llll llll, with leading and/or trailing
zeros, and has a total of
1 + (# 1 bits in H) + (# 1 bits in L)
bits. But F(X) will have
(# 1 bits in E) + (# 1 bits in H) + (# 1 bits in L)
bits, which is more for any E that satisfies Partial Result #1.
SUMMARY: X is
1lll llll llll llll 1100 eeee ehhh hhhh, where eeeee nonzero.
ABS(I) is (-I(X)) =
0mmm mmmm mmmm mmmm 0011 ???? ???? ????,
where m's are complements of l's
ASIDE: if J is an integer, and bit b is one, then J =
jjjj jjjj jjjj jjjj jjjj jj1? ???? ????
<--- b --->
and COMPLEMENT(J) =
kkkk kkkk kkkk kkkk kkkk kk0? ???? ????
and (-J) =
kkkk kkkk kkkk kkkk kkkk kk?? ???? ????
where k's are complements of j's.
PARTIAL RESULT #3: 143 <= E <= 159
2^(E - 129) >= ABS(I) >= 0011 0000 0000 0000 > 2^13
PARTIAL RESULT #4: E is not 159
Suppose E = 159. Then
[a] F(X) = 1lll llll llll llll 1100 1111 1hhh hhhh
Then [b] I(X) = 1lll llll llll llll 1100 1111 1hhh hhhh
Then [c] ABS(I(X)) = 0mmm mmmm mmmm mmmm 0011 0000 ???? ????
The integer part of F(X) [= ABS(I(X))] =
[d] ABS(I(X)) = 01hh hhhh h1ll llll llll llll l000 0000
From [c] and [d]: l24,l23,l22,l21 l20,l19,l18,l17 = 0011 0000
From [b] and [c]: m24,m23,m22,m21 m20,m19,m18,m17 = 1100 1111
From [c] and [d]: h1,h0,1,l30 l29,l28,l27,l26 = 1100 1111
Nope. Contradiction: 1..............................0
** ** ** ** ** ** ** **
PROBLEM: Partial Result #4 has very little bang for the buck, and needs
to be followed by Partial Results #5 (E is not 158), #6 (E is not 157),
..., #20 (E is not 143). They're doable, but error prone. And awfully
long. I've tried, and it appears to me that no E has a solution.
But a satisfactory proof that there are no solutions would seem to require
something neater than the likes of Partial Result #4.
|