Floating-Point Conversions (Cambridge (CIE) A Level Computer Science): Revision Note
Exam code: 9618
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)
Convert the number into binary (split into integer part + fractional part)
Example: 5 =
101₂, 0.25 =0.01₂, so 5.25 =101.01₂
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
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
Convert the exponent to 4-bit two’s complement (unbiased)
Positive exponents are normal binary
Negative exponents use two’s complement
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 →10101000000Mantissa =
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 →10101000000Mantissa =
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 |
|
|
|
|
−5.25 |
|
|
|
|
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)
Read the exponent (4 bits)
Convert from two’s complement into denary
Positive values = normal binary
Negative values = two’s complement
Check the mantissa sign
First bit = sign (0 = +, 1 = −)
Remember: the rest of the mantissa is just the fraction, not in two’s complement
Restore the fraction
Write it as
0.<fraction bits>in binaryExample: mantissa
010101000000→ fraction bits10101000000→0.10101₂
Apply the exponent
Shift the binary point right if exponent is positive, left if exponent is negative
Multiply the fraction by
2^(exponent)
Apply the sign
If the sign bit was 1, make the final result negative
Convert the following to denary (+)
Mantissa: 010101000000
Exponent: 0011Step 1: Exponent
0011₂ = +3
Step 2: Mantissa sign
First bit = 0 → positive
Step 3: Restore fraction
Fraction bits =
10101000000Fraction =
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: 0011Step 1: Exponent
0011₂ = +3
Step 2: Mantissa sign
First bit = 1 → negative
Step 3: Restore fraction
Fraction bits =
10101000000Fraction =
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) |
|---|---|---|
|
| +5.25 |
|
| −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
111OR 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 |
|---|---|
|
|
System 2
Mantissa | Exponent |
|---|---|
|
|
Unlock more, it's free!
Did this page help you?