I understand that the first bit is the sign and that the next 8 bits is the exponent. So in this example you would have 1.1001*2^-4 ? How do I then interpret this in decimal?
0 01111011 10010000000000000000000
I understand that the first bit is the sign and that the next 8 bits is the exponent. So in this example you would have 1.1001*2^-4 ? How do I then interpret this in decimal?
0 01111011 10010000000000000000000
1.1001b
is 1*1 + 0.5*1 + 0.25*0 + 0.125*0 + 0.0625*1
, or 1.5625
. Multiply that by 2**-4
(0.0625
) to get 0.09765625.
Since you already figured out that this is (in binary)1.1001*10^-100, now you just have to convert the binary number to decimal.
In decimal, each digit has a value one-tenth as much as the one before it. In binary, each digit has a value one-half as much as the one before it.
First 1.1001*10^-100 = 0.00011001.
Which is...
0 * 1 0 * 1
+ 0 * 1/2 + 0 * 0.5
+ 0 * 1/4 + 0 * 0.25
+ 0 * 1/8 + 0 * 0.125
+ 1 * 1/16 + 1 * 0.0625
+ 1 * 1/32 + 1 * 0.03125
+ 0 * 1/64 + 0 * 0.015625
+ 0 * 1/128 + 0 * 0.0078125
+ 1 * 1/256 + 1 * 0.00390625
0.0625 + 0.03125 + 0.00390625 = 0.09765625
That's all there is to it.