Real numbers — AQA A-Level Computer Science
Real numbers in AQA A-Level Computer Science refers to representing fractional values using fixed-point and floating-point binary formats. Mastering this topic requires understanding two's complement notation, normalisation to maximise precision, and the trade-offs between precision, range, underflow, and overflow.
Real numbers explained
The symbol ℝ denotes the set of real numbers, which the specification describes as the set of all possible real-world quantities.
Read the full explanation
In practice this means any measurable quantity, such as a length, mass, temperature or voltage, can be represented by a real number, including values that are not whole numbers, such as 3.75 m or −2.5 °C. Real numbers include positive values, negative values, zero and irrational values such as √2 and π. Understanding this scope helps you recognise when a data type must allow decimal or negative values, and when a whole-number type such as an integer would be inadequate. For example, a sensor reading of 21.4 °C cannot be stored faithfully as an integer without losing information. When answering questions, identify the quantity being described and check whether it can take any value on a continuous scale.
Your focus
- ℝ is the set of all 'possible real world quantities'.
Which command word is this?
Give a concise, factual answer without explanation or calculation, such as identifying whether a pattern is normalised or naming an error type.
Real numbers exam tips
Topic Overview
In Computer Science, real numbers are values containing fractional parts that cannot be represented using simple whole integers alone. AQA A-Level requires students to master two fundamental methods for encoding real numbers in binary: fixed-point representation, where the binary point is fixed at a designated location, and floating-point representation, which uses a mantissa and an exponent in scientific notation.
Understanding these representations is critical because digital hardware has finite bit widths, forcing engineers to balance numerical range against precision. Mastery of normalisation, rounding errors, underflow, and overflow enables students to understand low-level processor architecture, graphics processing, and scientific computation accuracy.
Key Concepts
- →Fixed-point binary allocates a predetermined number of bits before and after the binary point, providing constant absolute precision but a limited numerical range.
- →Floating-point binary divides available bits into a mantissa (significand) and an exponent, using the format mantissa * 2^exponent in two's complement.
- →Normalisation requires a mantissa to begin with '01' for positive numbers or '10' for negative numbers, maximising significant figures and eliminating redundant sign bits.
- →Precision is determined by the number of bits in the mantissa, whereas range is determined by the number of bits in the exponent.
- →Underflow occurs when a non-zero value is too small to be represented in the allocated format, whereas overflow occurs when a value exceeds the maximum representable limit.
Marking Points
- Identifies ℝ as the set of real numbers representing any possible real-world quantity.
- Recognises that real numbers include negative values, zero, positive values and non-integer values.
- Gives a suitable real-world example, such as a measured length or temperature, to illustrate the set.
- Distinguishes real numbers from integers by noting that integers cannot represent fractional quantities.
- Explains that the set is continuous, so between any two real values there is another real value.
Examiner Tips
- 💡Link the definition to a concrete measurable quantity when asked to explain or justify.
- 💡When choosing a data type, ask whether the quantity can take fractional or negative values.
- 💡Use the phrase 'continuous range of values' to describe the scope of real numbers accurately.
- 💡When converting floating-point numbers, explicitly show the binary point shift step by step before calculating final decimal values to secure working marks.
- 💡Always check whether the question specifies two's complement or sign and magnitude for both mantissa and exponent; AQA almost exclusively tests two's complement.
- 💡If asked why a specific number is not normalised, explicitly state that the first two bits are identical ('00' or '11') and explain that this wastes precision.
Common Mistakes
- Treats ℝ as only positive numbers or only whole numbers; correct by remembering that ℝ includes negatives and fractions.
- Confuses real numbers with rational numbers only; correct by recalling that irrational values such as π are also real.
- Assumes a real quantity can always be stored exactly on a computer; correct by recognising that finite precision can introduce rounding.
- Believing all decimal fractions can be represented exactly in binary. Many common decimal fractions like 0.1 and 0.2 result in recurring binary fractions and therefore suffer from representation errors.
- Assuming normalisation always starts with '01'. Negative numbers in two's complement must start with '10' because a leading '11' indicates redundant negative sign bits.
- Confusing absolute error with relative error. Absolute error is the numerical difference between the actual value and the stored value, whereas relative error is absolute error divided by the actual value.
Revision Plan
- 1Day 1-2: Review two's complement integers and practice converting decimal fractions into fixed-point binary representations.
- 2Day 3-4: Learn floating-point syntax, practicing conversions from binary floating-point patterns to decimal values.
- 3Day 5-6: Master normalisation rules for both positive and negative values, and practice converting denary values to normalised floating point.
- 4Day 7-8: Complete exam-style questions comparing range versus precision, calculating absolute and relative errors, and defining underflow and overflow.
Exam Question Types
- 📋Direct conversion calculations: Converting between denary numbers and normalised floating-point/fixed-point bit patterns.
- 📋Trade-off and comparison questions: Explaining the effect of changing the proportion of bits allocated to mantissa versus exponent.
- 📋Error analysis questions: Calculating absolute and relative rounding errors for values that cannot be represented exactly in binary.
- 📋Normalisation explanations: Explaining the purpose of normalisation or demonstrating how to normalise an unnormalised binary pattern.
Command Word Expectations (AQA)
Give a concise, factual answer without explanation or calculation, such as identifying whether a pattern is normalised or naming an error type.
Show complete working steps transitioning between denary and binary representations, arriving at a clearly labelled numerical answer.
Set out the cause and effect or reasons for a computing phenomenon (e.g., why normalisation preserves maximum precision or why 0.1 causes roundoff error).
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: A real number is stored in a 12-bit floating-point format using two's complement: an 8-bit mantissa followed by a 4-bit exponent. Convert the bit pattern 10101000 0011 into its decimal equivalent.
- 1.Step 1: Identify the mantissa and exponent components from the given bit pattern. Mantissa = 10101000 (8 bits), Exponent = 0011 (4 bits).
- 2.Step 2: Evaluate the exponent. The 4-bit two's complement value 0011 represents +3 in denary (0*(-8) + 0*4 + 1*2 + 1*1 = 3).
- 3.Step 3: Write out the mantissa with its implied binary point immediately after the first sign bit: 1.0101000.
- 4.Step 4: Apply the exponent of +3 by shifting the binary point 3 positions to the right: 1010.1000.
- 5.Step 5: Convert the shifted two's complement binary number to denary. Place values: -8, 4, 2, 1, and 0.5. Here we have 1*(-8) + 0*(4) + 1*(2) + 0*(1) + 1*(0.5) = -8 + 2 + 0.5 = -5.5.
Question: Represent the denary value -6.75 as a normalised 12-bit floating-point number with an 8-bit mantissa and a 4-bit exponent, both in two's complement.
- 1.Step 1: Convert positive 6.75 to fixed-point binary. 6 in binary is 0110, and 0.75 is 0.11, giving 00110.1100.
- 2.Step 2: Convert to negative (-6.75) using two's complement. Invert the bits of 00110.1100 to get 11001.0011, then add 1 to the least significant bit, yielding 11001.0100.
- 3.Step 3: Normalise the binary value so the first two bits are '10'. Shift the binary point left past the leading ones: 1.0010100 with a shift of 3 places to the left.
- 4.Step 4: Pad or truncate the mantissa to 8 bits: 10010100. Check: first two bits are '10', confirming negative normalisation.
- 5.Step 5: The binary point was shifted 3 places to the left, meaning the value must be multiplied by 2^3. The exponent is +3, which in 4-bit two's complement is 0011.
- 6.Step 6: Concatenate the 8-bit mantissa and 4-bit exponent to produce the final bit pattern.