Floating-Point Conversions (Cambridge (CIE) A Level Computer Science): Revision Note

Exam code: 9618

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

Denary to floating-point binary

How do you convert denary to floating-point binary?

  • For the following conversions we are assuming:

    • 12-bit mantissa (bit 0 is the sign: 0 = +, 1 = -)

    • 4-bit exponent (in two’s complement, unbiased)

  1. Convert the number into binary (split into integer part + fractional part)

    • Example: 5 = 101₂, 0.25 = 0.01₂, so 5.25 = 101.01₂

  2. Normalise the binary into the form 0.xxxxx × 2ⁿ

    • Move the binary point until there is one non-zero digit to the right of it

    • Count how many places the binary point moved = the exponent

  3. Build the mantissa (12 bits):

    • First bit = sign (0 for +, 1 for −)

    • Next 11 bits = binary digits after the binary point

    • Pad with zeros on the right if needed

  4. Convert the exponent to 4-bit two’s complement (unbiased)

    • Positive exponents are normal binary

    • Negative exponents use two’s complement

  5. Write the final floating-point number as (Mantissa | Exponent)

Example: +5.25

  • Step 1: Convert to binary

    • 5.25 = 101.01₂

  • Step 2: Normalise

    • 101.01₂ = 0.10101 × 2³

  • Step 3: Build mantissa (12 bits)

    • Sign = 0 (positive)

    • Fraction = 10101 → pad → 10101000000

    • Mantissa = 010101000000

  • Step 4: Exponent

    • +3 = 0011

  • Final representation:
    Mantissa = 010101000000
    Exponent = 0011

Example: −5.25

  • Step 1: Convert the magnitude (ignore the sign for now)

    • First, convert +5.25 to binary → 101.01₂

    • Normalise: 101.01₂ = 0.10101 × 2³

    • You always start by working with the positive version, then apply the negative sign later

  • Step 2: Build the mantissa (12 bits)

    • Sign = 1 (negative)

    • Fraction = 10101 → pad → 10101000000

    • Mantissa = 110101000000

  • Step 3: Exponent

    • Exponent is the same as for +5.25 → +3 = 0011

  • Final representation:
    Mantissa = 110101000000
    Exponent = 0011

Summary table

Value

Binary

Normalised

Mantissa (12-bit)

Exponent (4-bit)

+5.25

101.01

0.10101 × 2³

010101000000

0011

−5.25

−101.01

0.10101 × 2³

110101000000

0011

Floating-point binary to denary

How do you convert floating-point binary to denary?

  • For the following conversions we are assuming:

    • 12-bit mantissa (sign + 11 fraction bits)

    • 4-bit exponent (two’s complement, unbiased)

  1. Read the exponent (4 bits)

    • Convert from two’s complement into denary

    • Positive values = normal binary

    • Negative values = two’s complement

  2. Check the mantissa sign

    • First bit = sign (0 = +, 1 = −)

    • Remember: the rest of the mantissa is just the fraction, not in two’s complement

  3. Restore the fraction

    • Write it as 0.<fraction bits> in binary

    • Example: mantissa 010101000000 → fraction bits 101010000000.10101₂

  4. Apply the exponent

    • Shift the binary point right if exponent is positive, left if exponent is negative

    • Multiply the fraction by 2^(exponent)

  5. Apply the sign

    • If the sign bit was 1, make the final result negative

Convert the following to denary (+)

Mantissa: 010101000000
Exponent: 0011
  • Step 1: Exponent

    • 0011₂ = +3

  • Step 2: Mantissa sign

    • First bit = 0 → positive

  • Step 3: Restore fraction

    • Fraction bits = 10101000000

    • Fraction = 0.10101₂

  • Step 4: Apply exponent

    • 0.10101 × 2³ = 101.01₂ = 5.25₁₀

  • Step 5: Apply sign

    • Positive → stays +5.25

  • Final result: +5.25

Convert the following to denary (-)

Mantissa: 110101000000
Exponent: 0011
  • Step 1: Exponent

    • 0011₂ = +3

  • Step 2: Mantissa sign

    • First bit = 1 → negative

  • Step 3: Restore fraction

    • Fraction bits = 10101000000

    • Fraction = 0.10101₂

  • Step 4: Apply exponent

    • 0.10101 × 2³ = 101.01₂ = 5.25₁₀

  • Step 5: Apply sign

    • Negative → −5.25

  • Final result: −5.25

Examiner Tips and Tricks

  • Always handle sign first (0 = +, 1 = −)

  • The mantissa fraction is never in two’s complement for CIE

  • Only the exponent uses two’s complement

  • Show the normalisation step (0.xxxxx × 2ⁿ) if the question asks to “show your working”

Summary table

Mantissa

Exponent

Result (Denary)

010101000000

0011

+5.25

110101000000

0011

−5.25

Worked Example

Numbers are stored in two different computer systems by using floating-point representation.

System 1 uses:

  • 10 bits for the mantissa

  • 6 bits for the exponent

  • two’s complement form for both the mantissa and the exponent.

System 2 uses:

  • 8 bits for the mantissa

  • 8 bits for the exponent

  • two’s complement form for both the mantissa and the exponent.

Calculate the normalised floating-point representation of 113.75 and show how it would be represented in each of these two systems.

Show your working. [4]

Answer

  • conversion of 113.75 to binary seen 1110001.11 [1 mark]

  • exponent for normalisation 7 converted to binary 111 OR evidence of binary [1 mark]

  • point moved 7 places OR evidence of finding exponent = 7 [1 mark]

  • system 1 answer [1 mark]

  • system 2 answer showing correct version from system 1 [1 mark]

System 1

Mantissa

Exponent

0111000111

000111

System 2

Mantissa

Exponent

01110001

00000111

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science & English Subject Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.