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.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

Binary fractions

After the binary point the place values halve: 0.5, 0.25, 0.125, 0.0625, 0.03125 ...

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.

NumberBinaryNormalisedSignExponentSignificand
-0.3750.0111.1 x 2-2101101 (13)1000000000
12.51100.11.1001 x 23010010 (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

Worked example

Convert -0.375 to IEEE 754 half precision.

  1. Negative: sign 1.
  2. 0.375 = 0.011
  3. Normalise: 0.011 = 1.1 x 2-2 (point moved 2 places right).
  4. Exponent = -2 + 15 = 13 = 01101
  5. Significand = 1 then nine 0s: 1000000000

Answer: 1 01101 1000000000

Key idea: Denary to float: sign, binary, normalise to 1.f x 2E, store E + 15 in 5 bits, f padded right to 10 bits. Float to denary: reverse it, remembering the hidden 1.

Check yourself

  1. 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.

  2. 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.

  3. 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.

  4. Convert 0 10011 0011000000 from IEEE 754 half precision to denary.
    Show answer

    19. Exponent 19 - 15 = 4; 1.0011 x 24 = 10011 = 19.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.