teach-ict.com logo

THE education site for computer science and ICT

2. Example: adding with negative exponent

Consider these two numbers that have the usual mantissa and exponent parts

             0.1000      111
             0.0111      001 +

The first thing to do is to use the exponent to place the binary point. The first number is exponent 111 which is in twos compliment and is -1, so the point needs to shift 1 to the left. And the second exponent is 1 to the right. These are the two numbers re-aligned

             0.0100     (which is 2/8)
             0.111   +  (which is 7/8)

Next pad them out with zeroes

             0.0100   
             0.1110   +

Add them using the rules 0+0 = 0, 1 + 0 = 1, 1+1 = 0 carry 1, 1+1+1 = 1 carry 1.

             0.0100   
             0.1110   +
                  -------------
            01.0010  

This is 1 1/8 which is correct as 2/8 + 7/8 = 1 1/8

For a positive number to be normalised, it needs to start with 01, which it is, and also the binary point needs to be between the 01 pattern. The result above needs the point moved one to the left and so the exponent has to have +1 in it.

The final answer is (with mantissa and exponent)

             0.10010   001