• Sign bit: 0 = positive, 1 = negative
• Mantissa: The significant digits
• Exponent: Power of 2 to multiply by
Trade-off:
• More mantissa bits = more precision
• More exponent bits = larger range
A normalised floating point number has its mantissa starting with 01 (positive) or 10 (negative). This ensures maximum precision.
Binary Fractions
Bits to the right of the binary point have place values that halve each time: 1/2, 1/4, 1/8, 1/16 and so on. A number written with the binary point in a set position is in fixed point form.
In two's complement the leftmost bit has a negative place value:
1001.01 = -8 + 1 + 1/4 = -6.75
Converting Floating Point to Denary
In exam questions the mantissa and the exponent are both in two's complement, and the binary point of the mantissa comes after its first bit.
- 1.Convert the exponent to denary.
- 2.Write out the mantissa with the binary point after the first bit.
- 3.Move the binary point right by the exponent, or left if the exponent is negative.
- 4.Convert the fixed point number to denary. If the mantissa starts with 1, the leftmost bit has a negative place value.
Each number has an 8-bit mantissa and a 4-bit exponent.
| Mantissa | Exponent | Exponent in denary | Move the binary point | Fixed point | Denary |
|---|---|---|---|---|---|
| 01011000 | 0011 | 3 | 0.1011000 → 3 places right | 0101.1 | 5.5 |
| 10110000 | 0011 | 3 | 1.0110000 → 3 places right | 1011.0 | -5 |
| 01100000 | 1110 | -2 | 0.1100000 → 2 places left | 0.0011 | 0.1875 |
• 0101.1 = 4 + 1 + 1/2 = 5.5
• 1011.0 = -8 + 2 + 1 = -5
• 0.0011 = 1/8 + 1/16 = 0.1875
Normalising a Floating Point Number
A floating point number is normalised when the first two bits of its mantissa are different: 01 for a positive number, 10 for a negative number. Normalising gives the most precision possible from the bits available, and means each value has only one representation.
To normalise, shift the mantissa left until its first two bits differ, and subtract 1 from the exponent for each place moved. The value does not change, because each shift left doubles the mantissa and each 1 taken off the exponent halves the number again.
| Stage | Mantissa | Exponent | Value |
|---|---|---|---|
| Before | 00010110 | 0101 (5) | 0.0010110 → 5 places right = 101.1 = 5.5 |
| After | 01011000 | 0011 (3) | 0.1011000 → 3 places right = 101.1 = 5.5 |
A negative number works the same way: mantissa 11101000 with exponent 0100 (4) becomes mantissa 10100000 with exponent 0010 (2). Both are -3.
Converting Denary to Normalised Floating Point
- 1.Write the number in fixed point binary. For a negative number, write the positive value first and convert it to two's complement.
- 2.Move the binary point so that it sits after the first bit. The mantissa now starts 01 or 10.
- 3.The exponent is the number of places the point moved: positive if it moved left, negative if it moved right.
- 4.Fill the rest of the mantissa with 0s on the right, and write the exponent in two's complement.
Use an 8-bit mantissa and a 4-bit exponent.
| Denary | Fixed point binary | Point moved | Mantissa | Exponent |
|---|---|---|---|---|
| 6.75 | 0110.11 | 3 places left: 0.11011 | 01101100 | 0011 |
| -6.75 | 1001.01 | 3 places left: 1.00101 | 10010100 | 0011 |
| 0.1875 | 0.0011 | 2 places right: 0.11 | 01100000 | 1110 |
• The exponent is in two's complement too: 1110 is -2, not 14
• A normalised mantissa starts 01 or 10. If your answer starts 00 or 11, it is not normalised
• Pad the mantissa on the right with 0s, never on the left