Skip to topic
    ← Back to course topics

    Real numbers — AQA A-Level Computer Science

    Test yourself on Real numbers with AQA A-Level practice questions.

    Start free

    7 days Premium · Then free forever · No card, no charge

    Your focus

    1. Be familiar with the concept of a real number and the set ℝ of real numbers, which includes the natural numbers, the rational numbers and

    Real numbers exam tips

    Quick Revision Summary (Key Takeaway)

    In AQA A-Level Computer Science, real numbers are represented using either fixed-point or floating-point binary notations using two's complement for signed values. Floating-point representation divides bits into a mantissa and an exponent to provide a significantly larger dynamic range, requiring normalisation to maximise precision and eliminate redundant representations.

    Topic Overview

    The representation of real numbers covers how fractional and non-integer values are digitally encoded in computer systems using fixed-point and floating-point systems. Students explore the structural trade-offs between dynamic range and numerical precision, alongside the mechanics of two's complement encoding for both the mantissa and exponent.

    Understanding real number systems is essential for hardware design, numerical computing, and software development where precision loss, rounding errors, overflow, and underflow can result in critical software failures. It connects foundational binary arithmetic to high-level computer architecture and algorithmic complexity.

    Key Concepts
    • →Fixed-point binary allocates a predefined number of bits to the integer and fractional parts, resulting in constant absolute precision across its entire range.
    • →Floating-point representation uses a mantissa (fractional component) and an exponent (scale factor), allowing a wide dynamic range at the cost of varying absolute precision.
    • →Normalisation ensures that every real number has a single, unique representation and maximises numerical precision by avoiding leading redundant bits ('00' for positive, '11' for negative).
    • →Absolute error is the magnitude of difference between the actual value and its binary representation, whereas relative error measures this error as a proportion of the actual value.
    Examiner Tips
    • 💡When shifting during floating-point normalisation, write out the bit shifts step-by-step: each left shift of the mantissa requires subtracting 1 from the exponent.
    • 💡Always state whether an exponent is represented in standard two's complement or excess/biased notation, as specified in the question stem (AQA standard is two's complement).
    • 💡Remember that the binary point in an AQA normalised mantissa sits immediately between the sign bit and the first magnitude bit (e.g. 0.1... or 1.0...).
    Common Mistakes
    • Assuming floating-point numbers have higher precision than fixed-point: Floating point has a vastly larger dynamic range, but a fixed-point system of the same bit length can have higher absolute precision for values within its limited range.
    • Believing normalisation only applies to positive numbers: Negative numbers must also be normalised, and students frequently forget they must begin with '10' in two's complement.
    • Thinking all real numbers can be represented exactly: Decimal fractions with denominators containing prime factors other than 2 (such as 0.1 or 0.2) generate recurring binary expansions and cannot be represented exactly in binary.
    Revision Plan
    1. 1Day 1-2: Master fixed-point binary conversions, calculating range, precision, and two's complement fractions.
    2. 2Day 3-4: Practice converting unnormalised floating-point numbers to denary values and vice versa.
    3. 3Day 5: Drill normalisation techniques for both positive ('01') and negative ('10') values, tracking exponent changes.
    4. 4Day 6-7: Complete past exam questions focused on calculating absolute and relative errors, overflow, and underflow.
    Exam Question Types
    • 📋Direct conversion: Convert a binary floating-point representation (e.g. 10-bit mantissa, 6-bit exponent) into denary.
    • 📋Normalisation problems: Take an unnormalised binary float, normalise it, and update the exponent.
    • 📋Error analysis: Calculate absolute and relative errors when a given decimal fraction is stored in fixed-point or floating-point format.
    • 📋Comparative essay/discussion: Compare fixed-point and floating-point systems in real-time embedded environments (e.g. digital signal processors).
    Command Word Expectations (AQA)
    Calculate

    Show full mathematical working, step-by-step binary shifts, and state the final result clearly with appropriate units or signs.

    Explain

    Identify a specific operational mechanism (e.g. how normalisation prevents precision loss) and link it logically to the resulting effect or reason.

    Compare

    Provide balanced points detailing similarities, differences, advantages, and limitations of two approaches (such as fixed-point vs floating-point).

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Failing to recognize that a normalised negative floating-point number must start with binary '10' rather than '01'.
    ❌ Weak Answer (Loses Marks):A normalised number always starts with 01 because the first two bits must be different.
    Example improved answer:A normalised floating-point number must begin with two different bits to ensure maximum precision. A positive normalised number starts with '01' (a sign bit of 0 followed by 1), whereas a negative normalised number in two's complement starts with '10' (a sign bit of 1 followed by 0).
    Examiner Tip: Always check the sign bit first; if the sign bit is 1, repeatedly shift the mantissa left and decrement the exponent until the first two bits are '10'.
    Pitfall: Confusing underflow with overflow when dealing with calculations close to zero.
    ❌ Weak Answer (Loses Marks):Underflow occurs when a calculation produces a negative number that is too small to fit in the bits.
    Example improved answer:Underflow occurs when a calculated absolute value is too small to be represented with the available precision (it falls into the gap between zero and the smallest representable non-zero magnitude). Overflow occurs when a value is too large in magnitude to fit within the allotted range.
    Examiner Tip: State clearly whether the problem relates to dynamic range being exceeded (overflow) or numbers becoming indistinguishable from zero due to limited precision (underflow).
    Step-by-Step Worked Solutions

    Question: A real number is stored in an 8-bit mantissa and a 4-bit exponent, both in two's complement. Normalise the unnormalised floating-point value: Mantissa = 0000 1100, Exponent = 0101, and then determine its final denary value.

    1. 1.Step 1: Check the sign bit of the mantissa. The most significant bit is 0, so the number is positive. A normalised positive mantissa must begin with '01'.
    2. 2.Step 2: Shift the mantissa left until the first two bits are '01'. The mantissa is currently '0000 1100'. Shifting left by 3 positions gives '0110 0000'.
    3. 3.Step 3: Adjust the exponent to compensate for the left shifts. Shifting left by 3 positions multiplies the mantissa by 2^3, so we must subtract 3 from the exponent. The original exponent is 0101 (denary +5). New exponent = 5 - 3 = +2, which is binary 0010.
    4. 4.Step 4: Combine the normalised components: Mantissa = 0110 0000, Exponent = 0010.
    5. 5.Step 5: Calculate the denary value: Mantissa 0.1100000 = 0.5 + 0.25 = 0.75. Exponent 0010 = 2. Value = 0.75 * 2^2 = 0.75 * 4 = 3.0.
    Final Answer: Normalised Mantissa: 0110 0000, Normalised Exponent: 0010. Denary value: 3.0

    Question: A computer uses an 8-bit fixed-point representation with 4 integer bits and 4 fractional bits, using two's complement. Calculate the absolute error and relative error when approximating the denary value 3.6.

    1. 1.Step 1: Convert 3.6 to binary with 4 fractional bits (place values: 0.5, 0.25, 0.125, 0.0625). Integer part: 3 = 0011. Fractional part: 0.6 = 0.5 (0.1) + 0.0625 (0.0001) = 0.5625 (binary 0.1001). Adding another 0.0625 gives 0.625 (binary 0.1010).
    2. 2.Step 2: Compare representations to target 3.6: 0011.1001 = 3.5625 (difference 0.0375). 0011.1010 = 3.6250 (difference 0.0250). The closest representation is 0011.1010 = 3.625.
    3. 3.Step 3: Calculate absolute error: |Target - Stored| = |3.6 - 3.625| = 0.025.
    4. 4.Step 4: Calculate relative error: Absolute Error / Target = 0.025 / 3.6 = 1/144 = 0.00694 (or 0.694%).
    Final Answer: Absolute error = 0.025; Relative error = 0.00694 (0.694%)
    Active Recall Memory Test
    What are the first two bits of any normalised positive floating-point number in two's complement?
    Key Fact: 01
    What are the first two bits of any normalised negative floating-point number in two's complement?
    Key Fact: 10
    What is the formula for calculating relative error?
    Key Fact: Relative Error = Absolute Error / Actual Value (or |Actual - Stored| / Actual)
    Why can the denary value 0.1 not be represented precisely in standard binary floating-point?
    Key Fact: Because 0.1 has a recurring binary fractional expansion (0.000110011...) and cannot be written as a finite sum of powers of 1/2.
    Frequently Asked Questions
    Why is normalisation necessary in floating-point systems?
    Normalisation serves two critical purposes in computer systems. First, it ensures that each real number has a single, unique binary representation, making equality comparisons efficient and predictable. Second, by eliminating redundant leading zeros or ones, it maximises the number of significant digits stored in the mantissa, providing the highest possible precision for the given bit length.
    What is the main difference between overflow and underflow?
    Overflow occurs when a calculation produces a number whose magnitude is too large to be represented within the allocated exponent range. Underflow occurs when a calculation produces a non-zero value that is too small in magnitude to be represented by the smallest available precision, causing it to round down to zero. Both conditions lead to computational errors and unexpected program behaviour.
    When is fixed-point representation preferred over floating-point?
    Fixed-point representation is commonly used in low-power embedded processors, simple microcontrollers, and digital signal processors (DSPs) lacking dedicated floating-point units (FPUs). Because fixed-point arithmetic relies on simple integer hardware, it requires fewer processor clock cycles and less silicon area, making it faster and more power-efficient when the required range of values is strictly known in advance.
    How do you calculate the maximum and minimum representable values in floating-point?
    To find the maximum positive value, set the mantissa to the largest positive normalised value (0 followed by all 1s, representing nearly 1.0) and the exponent to the maximum positive signed integer. For the most negative value, set the mantissa to the most negative value (1 followed by all 0s, representing -1.0) and combine it with the maximum positive exponent, scaling -1.0 by the largest possible power of two.
    Why does changing the bit allocation between mantissa and exponent alter performance?
    In any fixed total bit length, increasing the number of bits allocated to the mantissa increases precision by providing more fractional binary places, but it decreases the dynamic range because fewer bits remain for the exponent. Conversely, increasing the exponent bits expands the dynamic range (accommodating vastly larger and smaller numbers) but reduces the precision of each represented number.