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 (in two’s complement)

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

Convert +5.25 to floating-point binary

  • Step 1: Convert 5.25 to binary

5 = 101  
0.25 = 0.01  
→ 5.25 in binary = 101.01
  • Step 2: Normalise (form 1.xxxxx × 2ⁿ)

101.01 → 1.0101 × 2²  
→ Mantissa (before padding): 1.0101
  • Step 3: Remove leading 1 and pad to 12 bits

Mantissa = 010100000000  
(1.0101 → drop leading 1, pad with 0s to 12 bits)
  • Step 4: Write exponent in 4-bit two’s complement

Exponent = 2 → 0010
  • Final answer

Mantissa

Exponent

010100000000

0010

Convert −5.25 to floating-point binary

  • Step 1: Convert +5.25 to normalised form

+5.25 = 1.0101 × 2² → mantissa = 010100000000
  • Step 2: Convert mantissa to two’s complement (negative)

    • Take the 12-bit two’s complement of 010100000000:

      • Invert: 101011111111

      • Add 1: 101100000000

    • Mantissa for −5.25 = 101100000000

  • Step 3: Exponent is the same (+2)

    • Two’s complement of +2 in 4-bit binary = 0010

  • Final answer

Mantissa

Exponent

101100000000

0010

Summary table

Value

Binary

Normalised

Mantissa (12-bit)

Exponent (4-bit)

+5.25

101.01

1.0101 × 2²

010100000000

0010

−5.25

−101.01

−1.0101 × 2²

101100000000

0010

Floating-point binary to denary

How do you convert floating-point binary to denary?

  • For the following conversions we are assuming:

    • 12-bit mantissa (in two’s complement)

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

Convert the following to denary (+)

Mantissa: 010100000000  
Exponent: 0010
  • Step 1: Convert exponent from 4-bit two’s complement to denary

0010 (binary) = +2 (denary)
  • Step 2: Add back the implicit binary point in the mantissa

    • Mantissa is stored without the leading 1 (because it’s normalised)

    • So:

Stored mantissa: 010100000000  
Restore: 1.01000000000
  • Step 3: Shift the binary point according to the exponent

    • Since exponent = +2 → shift binary point 2 places to the right:

1.01000000000 → 101.000000000
  • Step 4: Convert binary to denary

101 = 5  
0.000000000 = 0  

Final result: 5.0 (denary)

Convert the following to denary (-)

Mantissa: 101100000000  
Exponent: 0010
  • Step 1: Exponent is again 0010 → +2

  • Step 2: Convert 12-bit two’s complement mantissa to denary:

    • 101100000000 = negative value (MSB = 1)

    • Take two’s complement to find magnitude:

      • Invert: 010011111111

      • Add 1: 010100000000 → which is 1.01000000000

      • Convert: 101.0−5.0

  • Final result: −5.0 (denary)

Summary table

Mantissa

Exponent

Result (Denary)

010100000000

0010

+5.0

101100000000

0010

−5.0

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

You've read 0 of your 5 free revision notes this week

Unlock more, it's free!

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

the (exam) results speak for themselves:

Did this page help you?

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.