All subjects · Computer Science · WCP03 Advanced Principles of Computer Science
Floating point: converting between denary and binary
Edexcel IAL Computer Science · WCP03 Advanced Principles of Computer Science
This lesson drills the two conversions the exam asks for: denary fraction to IEEE 754 half precision, and half precision back to denary. No calculator is allowed, so learn the place values.
Binary fractions
After the binary point the place values halve: 0.5, 0.25, 0.125, 0.0625, 0.03125 ...
- 0.75 = 0.11
- 0.625 = 0.101
- 0.375 = 0.011
- 0.8125 = 0.1101
To convert a fraction, keep doubling it: each time the result reaches 1 or more, write 1 and subtract 1; otherwise write 0. 0.375 -> 0.75 (0) -> 1.5 (1) -> 1.0 (1): 0.011.
Denary to half precision
1. Write the sign bit (1 if negative), then work with the size of the number.
2. Convert to binary (whole part and fraction part).
3. Normalise to 1.xxxx x 2E by moving the point; count the moves (left gives positive E, right gives negative E).
4. Exponent = E + 15, as 5 bits.
5. Significand = bits after the point, padded with 0s on the right to 10 bits.
| Number | Binary | Normalised | Sign | Exponent | Significand |
|---|---|---|---|---|---|
| -0.375 | 0.011 | 1.1 x 2-2 | 1 | 01101 (13) | 1000000000 |
| 12.5 | 1100.1 | 1.1001 x 23 | 0 | 10010 (18) | 1001000000 |
Half precision to denary
1. Read the sign.
2. Convert the exponent to denary and subtract 15.
3. Write 1. followed by the significand.
4. Move the point by the true exponent (right if positive, left if negative).
5. Convert to denary and apply the sign.
Example: 0 10010 1010000000: exponent 18 - 15 = 3; 1.101 x 23 = 1101 = 13.
Common mistakes
- Forgetting to add (or subtract) the bias.
- Storing the hidden 1 in the significand.
- Padding the significand on the left instead of the right.
- Using two's complement for the exponent: IEEE 754 uses a bias, not two's complement.
Worked example
Convert -0.375 to IEEE 754 half precision.
- Negative: sign 1.
- 0.375 = 0.011
- Normalise: 0.011 = 1.1 x 2-2 (point moved 2 places right).
- Exponent = -2 + 15 = 13 = 01101
- Significand = 1 then nine 0s: 1000000000
Answer: 1 01101 1000000000
Check yourself
- Convert 6.5 to IEEE 754 half precision. Write it as sign, exponent and significand separated by spaces.
Show answer
0 10001 1010000000. 6.5 = 110.1 = 1.101 x 22; exponent 17 = 10001; significand 1010000000: 0 10001 1010000000.
- Convert -10.25 to IEEE 754 half precision (sign exponent significand, separated by spaces).
Show answer
1 10010 0100100000. 10.25 = 1010.01 = 1.01001 x 23; sign 1; exponent 18 = 10010; significand 0100100000: 1 10010 0100100000.
- Convert 0.625 to IEEE 754 half precision (sign exponent significand, separated by spaces).
Show answer
0 01110 0100000000. 0.625 = 0.101 = 1.01 x 2-1; exponent 14 = 01110; significand 0100000000: 0 01110 0100000000.
- Convert 0 10011 0011000000 from IEEE 754 half precision to denary.
Show answer
19. Exponent 19 - 15 = 4; 1.0011 x 24 = 10011 = 19.
- Convert 1 01110 1010000000 from IEEE 754 half precision to denary.
Show answer
-0.8125. Exponent 14 - 15 = -1; 1.101 x 2-1 = 0.1101 = 0.8125; negative: -0.8125.
- Convert 0 01100 0100000000 from IEEE 754 half precision to denary.
Show answer
0.15625. Exponent 12 - 15 = -3; 1.01 x 2-3 = 0.00101 = 0.15625.
- When 12.5 is stored in half precision, what is the stored exponent in denary?
Show answer
18. 12.5 = 1100.1 = 1.1001 x 23; stored exponent = 3 + 15 = 18.
- When the significand bits of a normalised number are fewer than 10, where are the extra 0s added?
- On the left, before the first bit
- On the right, after the last significant bit
- In the exponent field
- Nowhere; the number is stored in fewer bits
Show answer
On the right, after the last significant bit. Trailing zeros after the point do not change the value.
Sources
- Pearson Edexcel International Advanced Subsidiary and Advanced Level in Computer Science specification (2026), Issue 1
- Pearson Edexcel IAL Computer Science sample assessment materials (Unit 3 paper, resource booklet and mark scheme)
- Wikipedia: Half-precision floating-point format
Last updated 8 November 2026. Spotted a mistake? Tell us.