Answer:
The resulting floating bit representation is:
0 00101010101010101 000001 (24 bits)
Explanation:
Converting 1/3 in decimal: 0.3333...
For converting decimal number into binary we know that the digits on the left of decimal are multiplied with positive powers of 2 (starting from zero) while digit on right side are multiplied with negative powers of 2 (starting from -1).
For example: The number 123.45 (decimal) is equal to:
=1 * 10^2 + 2 * 10^1 + 3 * 10^0 + 4 * 10^-1 + 5 * 10^-2
=1 * 100 + 2 * 10 + 3 * 1 + 4 * 0.1 + 5 * 0.01
Now for the decimal number 0.3333... the pattern becomes:
0*0 . 3*2^-1+3^-2+3^-3+3^-4.....
The first negative power (2^-1 = 0.5) is too large to fit. The next one is 2^-2 = 0.25 and it fits, so let's subtract that: 0.3333… - 0.25 = 0.08333… The next power that fits is 2^-4 = 0.0625. Subtracting that from the remaining result we get 0.08333…- 0.0625 = 0.0208333…
Continuing on this line we get:
0.3333333…. (decimal) = 0.0101010101010101….. (binary)
Now for creating a 24 bit floating point format that uses Binary Coded Decimal we have to assign bits as follows:
- 6 bits for the exponent
- 17 bits for the mantissa.
- In this case the sign bit is 0 (1 bit) because the number is non-negative.
As we need not to normalize obtained number, then the exponent will be simply 1, and the mantissa remains: 00101010101010101...
Now
The mantissa is 0.0101010101010101 (17 bits)
The exponent is 000001 (6 bits).
The resulting floating bit representation is 0 00101010101010101 000001