How would one represent the number -4 as an 8-bit normalised, 2's complement, floating point, with 4 bits dedicated to the exponent?

As a normal 4-bit 2's complement number, it would be represented as 1100.

How would this be normalised, with the start of the mantissa being 1.0?

Would it be 1.000 0010, with the extra 1 on the left (after evaluation to a normal 2's compliment number) being filled in?

If so, how would you know to fill it with a 1, because it starts with a 1?

AFAIK, there is no standard with that format.

You can nevertheless try to imitate the old MIL-STD-1750A floating point format, which had two's complement mantissas and exponents.

The two's complement mantissa range is -1.0 to 0.999999....

Something like that :

                     Mantissa Exponent
'   0 =                  0000 0000
'0.25 =  0.5 * 2**-1 =   0100 1111
' 0.5 =   0.5 * 2**0 =   0100 0000
'  +1 =   0.5 * 2**1 =   0100 0001
'  +2 =   0.5 * 2**2 =   0100 0010
'  +4 =   0.5 * 2**3 =   0100 0011
'  -1 =  -1.0 * 2**0 =   1000 0000
'  -2 =  -1.0 * 2**1 =   1000 0001
'  -4 =  -1.0 * 2**2 =   1000 0010

Note the asymmetry between +1 and -1.

etc...

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.