Normalisation
Further notes on normalisation
Numbers can be represented in different ways using floating-point notation. To illustrate this point using decimal, suppose you have this number: 45379510 How could this be represented using the floating-point system?
-
- 453795 x 102 or
- 4537 x 104 or
- 45 x 106 or
- 0.0045379510 x 1010 and so on.
Look at this example, which uses 10 places after the decimal point: 0.0045379510 x 1010 You could write it like this 0.00453795 x 1010 if you only had 8 places after the decimal point. The problem with this is that you have lost some of the accuracy of the number. If you only had 8 places after the decimal point, you might prefer this: 0.45379510 x 108 You have kept the accuracy and still used only 8 places after the decimal point. Also, by having a smaller number of places after the decimal point, you have increased the number of places you can use for the exponent, thereby increasing the range of numbers you can represent.
How did we keep the accuracy for the same number of mantissa places? We did it by getting rid of 'leading zeros'. In other words, we didn't write down 0.00453 etc, we wrote down 0.453 etc. We ended up with the same number, improved accuracy and still used only 8 places for the mantissa. The process of ensuring the maximum accuracy of a number for a given mantissa size is known as ‘normalisation’.
-
- Normalisation ensures that maximum accuracy of a number for a given number of bits.
- It also ensures that each number has only one possible bit pattern to represent it!
Some examples:
-
- 3004 x104 normalised is 0.3004 x 108 (Check to see if these numbers are the same.)
- 0.0005 x 102 normalised is 0.5 x 10-1 (Check to see if these numbers are the same.)
Normalisation of binary numbers
Converting binary numbers into their normalised form is a similar process.
Consider the binary number 00001000 where there are 5 bits for the mantissa and 3 for the exponent. We have to normalise this number.
-
- The mantissa is 00001 (Think of it as 0.0001)
- We move the decimal 3 places to the right so it begins 0.1
- This gives us 01000 if we remove the decimal point and leading zeros and add following zeros.
- The exponent must be -3, to get the decimal point back to where it was to start with.
- -3 is 101 as a two’s complement number if you have 3 digits for the exponent.
- The normalised version of 00001000 is therefore 01000101
Consider the binary number 00010011 where there are 5 bits for the mantissa and 3 for the exponent. We have to normalise this number.
-
- The mantissa is 00010 (Think of it as 0.0010)
- We move the decimal 2 places to the right so it begins 0.1
- This gives us 01000 if we remove the decimal point and leading zeros and add following zeros.
- The exponent was 011 (move 3 to the right).
- 3 places to the right and 2 places to the left means overall, the exponent should be one place to the right. This is represented as 001
- The normalised version of 00010011 is therefore 01000001
Consider normalising the binary number 0000010100 000010 There are 10 bits for the mantissa and 6 for the exponent.
-
- The mantissa is 0000010100 (Think of it as 0.000010100)
- We move the decimal point 4 places to the right so it begins 0.1 and to get it back to where it was, we must move it 4 places to the left.
- This gives us 0101000000 if we remove the decimal point and leading zeros and add following zeros.
- The exponent was 000010 (move 2 places to the right).
- 2 places to the right and 4 places to the left means overall, the exponent should move 2 places to the left.
- -2 is 111110 as a two’s complement number.
- The normalised version of 0000010100 000010 is therefore 0101000000 111110