Login

Back 

Negative floating point numbers using one byte 

Negative binary floating-point number representation using one byte
Now let's look at some negative numbers. These are some more steps in dealing with negative numbers than in dealing with positive numbers but it is still a mechanical process. Work through the following examples carefully, taking note of each step.

Remember! A normalised negative binary floating-point number always begins 10

Example 16. Convert 10010010 (using 5 bits for the mantissa and 3 for the exponent) into decimal.

    1. The mantissa is a normalised negative number because the left-most bits are 10
    2. Write down the mantissa with the decimal point between the first two digits: 1.0010
    3. Because it’s negative, there is an extra step. You must convert it into a negative binary number that is not in 2s complement form. 1.0010 therefore becomes -(0.1110) Notice that the decimal place stays where it is for the moment. If you are having trouble with this step, refer back to the ‘Getting back to a negative denary number’ section.
    4. The exponent is 010, which is the same as +2.
    5. We therefore need to move the decimal point two places to the right.
    6. The mantissa goes from -(0.1110) to -(011.10)
    7. Getting rid of redundant zeros gives us -(11.1)
    8. Converting this fixed-point number gives us -(3.5) or simply -3.5

Example 17. Convert 10111110 (using 5 bits for the mantissa and 3 for the exponent) into decimal.

    1. The mantissa is a normalised negative number because the left-most bits are 10
    2. Write down the mantissa with the decimal point between the first two digits: 1.0111
    3. Because it’s negative, there is an extra step. You must convert it into a negative binary number that is not in 2s complement form. 1.0111 therefore becomes -(0.1001) Notice that the decimal place stays where it is for the moment.
    4. The exponent is 110, which is the same as -2.
    5. We therefore need to move the decimal point two places to the left.
    6. The mantissa goes from -(0.1001) to -(0.001001)
    7. There aren’t any redundant zeros in this case.
    8. Converting this fixed-point number gives us -(1/8 + 1/64) or simply -0.140625

z14 

z15

Converting negative denary numbers into normalised binary floating-point numbers is simply a reverse of what we have just been doing.

Example 18. Convert -5.5 into a normalised binary floating-point number using 5 bits for the mantissa and 3 bits for the exponent.

    1. This is a negative number. Convert -5.5 into a fixed-point number in two's complement form.
    2. Now +5.5 is 101.1
    3. Pack the front of this number with excess zeros to make the mantissa the correct size. You now get 0101.1
    4. The two's complement form of this is 1010.1
    5. The normalised form of 1010.1 is 1.0101. (Just move the decimal point left to the left-most 10 pair, and put the decimal place between the one and the zero).
    6. To get the decimal place of the normalised form back to its pre-normalised form, the decimal point needs to be moved 3 places to the right. The exponent therefore is 011
    7. Putting all this together gives 10101011

Now try reconverting this normalised binary floating-point number using the method you saw in examples 16 and 17 and see if you can get -5.5

Example 19. Convert -1.25 into a normalised binary floating-point number using 5 bits for the mantissa and 3 bits for the exponent.

    1. This is a negative number. Convert -1.25 into a fixed-point number in two's complement form.
    2. Now +1.25 is 1.01
    3. Pack the front of this number with excess zeros to make the mantissa the correct size. You now get 001.01
    4. The two's complement form of this is 110.11
    5. The normalised form of 110.11 is 11.011 (Just move the decimal point left to the left-most 10 pair, and put the decimal place between the one and the zero).
    6. Now there is another step here. We need to discard the excess 'ones' in front of the 1.0 pair, just like we would discard excess 'zeros' in positive numbers. Excess zeros are then added to the end of the number to make the mantissa the correct size. In this example, 11.011 becomes 1.0110
    7. To get the decimal place of the normalised form back to its pre-normalised form, the decimal point needs to be moved 1 place to the right. The exponent therefore is 001
    8. Putting all this together gives 10110001

Now try reconverting this normalised binary floating-point number using the method you saw in examples 16 and 17 and see if you can get -1.25

z16

Back