Dealing with 2's complement with floating point

Both the exponent and the mantissa are written in 2's complement. The mantissa, if negative, will make the whole floating point number negative. The exponent, if negative, will not make the number negative rather it will effect the placement of the decimal point.

If the exponnet is positive then the floating point will move to the right making the number bigger. If the exponent is negative then it will make the number smaller. Look at the follwoing two examples -

0.10000 011 = 0.1 * 2 ^ 3 = 100.0 = 4

0.10000 101= 0.1 * 2 ^ -3 = 0.0001 = 0.0625

Note - If you have forgotten how to deal with 2's complement then you should recap it here.

When dealing with a negative mantissa you need to flip the bits first and then apply the exponent. Look the following worked through example -

  1. 11101 010 - Floating point number
  2. 00011 010 - flip the bits of the mantissa as it is a negative number
  3. 0.1100 - move the decimal point based on the exponent
  4. 0.75 - get the denary value
  5. -0.75 - make it negative as the whole number was a negative number.

When dealing with a floating point number you can follow these steps

  1. if the mantissa starts with 1 then it is negative so
    1. Copy to the first 1 (starting on the right)
    2. Then flip the rest of the bits
  2. put in a decimal point between the first and second bit on the left
  3. work out the denary value of the exponent. If it starts with 1 then it is negative
  4. move the decimal point to the right if positive or left if negative
  5. calculate the value of both sides of the decimal point.
  6. If the mantiassa was negative then add a negative sign infront of your answer.