Computer Science 9618/32 — May/June 2023
Cambridge A-Level · Advanced Theory · worked solutions for every part, with the mark scheme
Topics Data Representation · Hardware and Virtual Machines · System Software · Further Programming · Security · Communication and Internet Technologies · +2 more
Numbers are stored in a computer using floating point representation with:
• 10 bits for the mantissa
• 6 bits for the exponent
• two’s complement form for both the mantissa and exponent.
Write the normalised floating-point representation of the following binary number using this system:
0101010.111
Show your working.
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
| Mantissa | | | | | | | | | | Exponent | | | | | |
|----------|-|-|-|-|-|-|-|-|-|-|----------|-|-|-|-|-|
| | | | | | | | | | | | | | | | |
Working
0101010.111 = 101010.111
Move the binary point 6 places left to normalise:
0.101010111 × 2^6
Mantissa = 0101010111
Exponent = 000110
Answer
Mantissa: 0101010111
Exponent: 000110
Mantissa 0101010111, exponent 000110
Background Concept
In this floating-point system, the number is split into two parts:
- the mantissa, which stores the significant bits of the number
- the exponent, which stores how far the binary point has been moved
Both are stored in two's complement.
For Cambridge 9618 floating-point questions, a normalised mantissa must begin with:
01for a positive number10for a negative number
That rule means the sign bit and the next bit must be different. For a positive value, the first bit is 0, so the next bit must be 1.
With a 10-bit mantissa, the first bit is the sign bit and the remaining bits hold the fractional part after the binary point. With a 6-bit exponent, the shift amount must also fit in two's complement form.
Understanding the Question
The question gives the binary number 0101010.111 and asks for its normalised floating-point representation using:
- a 10-bit mantissa
- a 6-bit exponent
- two's complement for both
So we must:
- rewrite the number in normalised binary floating-point form
- write the 10 mantissa bits
- write the 6 exponent bits
The key clue is the word normalised. That tells us not to leave the number as it is; we must shift the binary point until the positive mantissa starts 01.
Approach
The method is:
- Ignore any unnecessary leading zero before the number.
- Move the binary point left until the value is of the form
0.1...for a positive number. - Count how many places the binary point moved. That count becomes the exponent.
- Write the mantissa bits to fill exactly 10 bits.
- Convert the exponent into 6-bit two's complement.
Step-by-Step Reasoning
Start with:
0101010.111
The leading 0 on the far left does not change the value, so this is:
101010.111
To normalise a positive number, we want it in the form:
0.1... × 2^n
Move the binary point from 101010.111 to 0.101010111.
That is a shift of 6 places to the left, so:
101010.111 = 0.101010111 × 2^6
Now write the mantissa.
Because the mantissa has 10 bits total, and the number is positive:
- sign bit =
0 - then the fractional bits are
101010111
So the 10-bit mantissa is:
0101010111
Next, write the exponent +6 in 6-bit two's complement.
Positive two's complement values are written as ordinary binary with leading zeroes:
6 = 000110
So the exponent is:
000110
Therefore the floating-point representation is:
- Mantissa:
0101010111 - Exponent:
000110
Key Takeaways
- A normalised positive two's complement mantissa starts
01. - Normalising means moving the binary point and storing the shift count in the exponent.
- The exponent must also fit the specified bit length and representation.
- Always fill the mantissa to the exact number of bits given.
Common Mistakes
- Using
1010101110or another unnormalised pattern: the mantissa must be in normalised form, not just copied from the original number. - Forgetting the sign bit: the 10-bit mantissa includes the sign bit.
- Using the wrong exponent: count the number of places the binary point moved carefully.
- Writing the exponent in unsigned binary instead of two's complement: here
+6looks the same, but the question explicitly states two's complement. - Normalising to
1.01010111 × 2^5: that is a valid scientific-style binary form, but not the Cambridge two's complement mantissa format used here.
Things to Be Careful About
- In this syllabus, floating-point mantissas in two's complement are usually written with the binary point immediately after the sign bit.
- For a positive number, the normalised mantissa must begin
01, not00and not11. - Make sure the mantissa is exactly 10 bits and the exponent exactly 6 bits.
- Do not lose or add bits accidentally when shifting the binary point.
- Check that the exponent value matches the direction and number of shifts.
Describe the reason why the normalised form of the following binary number cannot be represented accurately using this system.
0101011.111001
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................
Answer
0101011.111001normalises to0.101011111001 × 2^6.- This needs more than 10 bits in the mantissa.
- Therefore the extra bits cannot be stored, so the value must be rounded or truncated and cannot be represented exactly.
The normalised mantissa is too long for 10 bits, so bits are lost and the value must be rounded or truncated.
Background Concept
A floating-point number is only as accurate as the number of bits available in its mantissa. The mantissa stores the significant digits of the value, while the exponent stores the scale.
That means two different things can stop a value being represented exactly:
- the exponent might be too large or too small to fit
- the mantissa might not have enough bits to hold all significant digits
When the mantissa is too short, the computer must either:
- truncate the extra bits, or
- round to the nearest storable value
Either way, the stored number is not exact. This is a rounding error or loss of precision.
Understanding the Question
The question asks why the normalised form of 0101011.111001 cannot be represented accurately in this system.
The important word is accurately. That means the issue is not just finding the normalised form; we must explain why the system cannot store the value exactly.
The system still uses:
- a 10-bit mantissa
- a 6-bit exponent
- two's complement
So we need to check whether the normalised number fits into those field sizes.
Approach
The best approach is:
- normalise the given binary number
- inspect how many bits the mantissa would need
- compare that with the available 10 bits
- explain what happens when there are too many bits
This tells us whether the problem is exponent range or mantissa precision.
Step-by-Step Reasoning
Start with:
0101011.111001
Ignoring the unnecessary leading zero gives:
101011.111001
Now normalise it for a positive two's complement mantissa:
0.101011111001 × 2^6
So the exponent is 6, which is small and easy to store in 6-bit two's complement. Therefore, the exponent is not the problem.
Now look at the mantissa.
The normalised mantissa would be based on:
0.101011111001
To store that exactly, we would need:
- 1 sign bit (
0) - all the fractional bits
101011111001
That is more than the 10 bits available in the mantissa field.
A 10-bit mantissa can hold only:
- 1 sign bit
- 9 more bits of precision
But this value needs more significant bits than that. So some trailing bits would have to be discarded or rounded.
For example, the stored mantissa could only keep the first 10 bits, such as 0101011111, and the remaining bits would be lost. Because those lost bits are not all zero, the stored value is different from the original value.
So the correct reason is:
- the number can be normalised
- the exponent fits
- but the mantissa is too long to store exactly
- therefore the value must be rounded or truncated, causing inaccuracy
Key Takeaways
- Floating-point inaccuracy often comes from the mantissa length, not the exponent.
- If extra non-zero bits remain after the available mantissa bits are filled, the value cannot be stored exactly.
- Normalising first helps you see clearly whether the issue is exponent range or mantissa precision.
- Rounding and truncation both produce an approximation when the mantissa is too short.
Common Mistakes
- Saying the number cannot be normalised: it can be normalised; the real issue is storing it exactly afterward.
- Blaming the exponent: here the exponent is only
6, which fits easily in 6 bits. - Saying it overflows: overflow refers to a value outside the range of the exponent, which is not the case here.
- Not mentioning the mantissa length: the key mark point is that the mantissa needs more bits than the system provides.
- Saying the value is inaccurate without explaining why: you must connect the inaccuracy to rounding or truncation of extra bits.
Things to Be Careful About
- Check the normalised form first before deciding what the problem is.
- Distinguish between range problems (overflow/underflow) and precision problems (rounding/truncation).
- A value is only exact if all significant bits fit into the mantissa field.
- If the omitted bits are all zero, the value may still be exact; here they are not all zero, so precision is lost.
- Keep the Cambridge normalisation rule in mind: for a positive two's complement mantissa, the leading bits must be
01.
The rest of this paper
10 more questions- Q2Data Representation5M
- Q3System Software9M
- Q4Further Programming4M
- Q5Security5M
- Q6Data Representation9M
- Q7Communication and Internet Technologies6M
- Q8Hardware and Virtual Machines6M
- Q9Hardware and Virtual Machines10M
- Q10Artificial Intelligence (AI)6M
- Q11Computational Thinking and Problem-solving10M