I'm trying to understand how to get the mantissa and the exponent in this case. Here's an example I have in my book.
I have this formula (-1)^s * (1 + M) * b^E-e = x
s = 0 or 1 (the sign)
M = mantissa
b = base (In this case 2)
E = the exponent of this mantissa
e = 127 (for a 32bits system)
Still in by book, for x = 1.602177 * 10^-19, I get
S = 0,
M = 0.4777474,
E = 64
which it works.
1 * 1.4777474 * 2^-63 = 1.60210^-19*
However, I don't know how to get the values for M and E.
I read that E = log b |x| then M = |x|b^-E
In this case E = log2(1.602177*10^-19) = -62.43660 (I'm using a website for the log base 2, so I'm not sure about the result so I tried E = -62 and -63).
M = (1.602177 * 10^-19) * 2^-(-62) = 0.7388737
M = (1.602177 * 10^-19) * 2^-(-63) = 1.4777474
Correct me if I'm wrong but the mantissa is the digits to the right of the floating point. In this case 0.4777474 looks right.
At this point I have E = -63 and M = 0.4777474, but E should be 64