bitbit-representation

Bit representation using excess-3 and mantissa


If a float number is stored in one byte such that the first bit is the sign, the next three bits represent the exponent in excess-3 notation and the last four bits represent the mantissa, then the bit pattern 00100100 represents? I understand that number will positive as the first bit is 0, I also understand that 010 excess-3 is -1 and 0100 is 4, but how do I get a float number having all these?


Solution

  • normalized binary floating point numbers are of the form (+/-) 1.mmm... * 2^exp, where mmm... represents the digits of the mantissa.

    beware that the mantissa (0100) is the fractional part of the normalized number, so it is 1.0100, which is not 4.

    putting it all together will give

    +1.0100 * 2^-1
    

    which is 0.101