Skip to topic
    ← Back to course topics

    Numbers with a fractional part — AQA A-Level Computer Science

    Numbers with a fractional part are represented in computer systems using fixed-point and floating-point binary formats, balancing range and precision. In AQA A-Level Computer Science, students must master two's complement fractional conversions, floating-point normalisation, and the analysis of rounding and truncation errors.

    Numbers with a fractional part explained

    This statement requires you to know how numbers with a fractional part are represented in binary, and in the two named forms the specification lists, which are fixed-point and floating-point representation.

    Read the full explanation

    In fixed-point form, the binary point sits at a fixed position, so bits to the right of the point represent negative powers of two: 0.5 is 2⁻¹, 0.25 is 2⁻², and 0.125 is 2⁻³. For example, 101.11 represents 4 + 1 + 0.5 + 0.25 = 5.75. In floating-point form, a number is stored as a mantissa and an exponent, so the binary point effectively moves according to the exponent. The mantissa holds the significant digits and the exponent records the scale. For example, 5.75 is 101.11 in binary, which normalises to 1.0111 × 2². Recognise that both forms trade range against precision, and that floating-point allows a much wider range of values for the same number of bits.

    Your focus

    1. Know how numbers with a fractional part can be represented in:

    Which command word is this?

    Transform a value from one format to another (e.g. denary to floating-point), showing clear intermediate binary steps.

    Numbers with a fractional part exam tips

    Topic Overview

    Numbers with a fractional part allow computer systems to represent real numbers that lie between whole integers. In digital processors, these values must be mapped onto finite binary bit patterns using either fixed-point or floating-point notation.

    Understanding these representations is essential for assessing system trade-offs between precision and dynamic range. It underpins how software handles numerical calculations, roundoff errors, and limits in scientific computing and graphics processing.

    Key Concepts
    • →Fixed-point binary allocates a predetermined number of bits to the whole integer part and fractional part, providing uniform absolute precision but a limited dynamic range.
    • →Floating-point representation splits bits into a mantissa (sign and precision) and an exponent (scale and range), analogous to standard scientific form.
    • →Normalisation maximises precision for a given bit width by ensuring the mantissa starts with 01 (positive) or 10 (negative).
    • →Absolute and relative errors arise when numbers cannot be represented exactly in binary (such as 0.1 denary), leading to rounding or truncation issues.
    • →Underflow occurs when a non-zero number is too small to be represented, while overflow occurs when a magnitude exceeds the maximum representable limit.
    Marking Points
    • Explains that bits right of the binary point represent negative powers of two, such as 2⁻¹ and 2⁻².
    • Converts a fixed-point binary fraction to denary by summing the place values of its set bits.
    • Describes floating-point form as a mantissa combined with an exponent.
    • Normalises a binary value correctly, for example 101.11 as 1.0111 × 2².
    • Explains the trade-off between range and precision for fixed-point and floating-point forms.
    Examiner Tips
    • 💡Write the negative powers of two (2⁻¹, 2⁻², 2⁻³) beside the bits after the binary point before converting.
    • 💡Name the two parts of a floating-point number, mantissa and exponent, and state what each one stores.
    • 💡When comparing the two forms, give one advantage and one limitation of each, linked to range and precision.
    • 💡Always state whether you are working in two's complement or sign-and-magnitude before beginning conversions.
    • 💡Clearly separate the mantissa and exponent using labels or boxes when writing out exam working to avoid confusion across the boundary.
    • 💡When explaining the effect of allocating more bits to the mantissa vs exponent, use the exact keywords: 'greater precision' for mantissa, and 'greater range' for exponent.
    Common Mistakes
    • Gives bits after the binary point positive powers of two, such as 2¹ for the first place after the point; the first place after the point is 2⁻¹.
    • Describes floating-point as simply storing a decimal fraction, without identifying the mantissa and exponent parts.
    • Forgets that a floating-point number is written as mantissa × 2 to the power of the exponent, so the exponent scales the value.
    • Assuming every denary fraction with a terminating decimal (like 0.1 or 0.2) terminates in binary; in reality, base-10 fractions whose denominators contain prime factors other than 2 become repeating binary recurring fractions.
    • Thinking normalisation changes the mathematical value of the number; normalisation adjusts both mantissa and exponent so the value remains identical while using the maximum possible significant digits.
    • Believing shifting a mantissa right increases the exponent; shifting right divides the mantissa by 2, so the exponent must increase by 1 to balance the magnitude.
    Revision Plan
    1. 1Day 1: Master two's complement fixed-point conversions both to and from denary, practicing with varying binary point positions.
    2. 2Day 2: Practice converting denary real numbers into unnormalised and normalised floating-point formats with given mantissa and exponent lengths.
    3. 3Day 3: Focus on negative floating-point numbers, ensuring full fluency with the '10' leading bit pattern rule.
    4. 4Day 4: Work through exam questions calculating absolute and relative errors caused by truncation and rounding.
    5. 5Day 5: Complete timed past paper questions comparing fixed-point vs floating-point trade-offs and handling overflow/underflow scenarios.
    Exam Question Types
    • 📋Calculation: Converting a given two's complement floating-point representation into its denary equivalent.
    • 📋Normalisation: Shifting an unnormalised floating-point number into normalised form and adjusting the exponent accordingly.
    • 📋Comparative analysis: Explaining the impact on precision and range when shifting bit allocation between the mantissa and the exponent.
    • 📋Error evaluation: Calculating absolute error and relative error resulting from binary truncation or rounding.
    Command Word Expectations (AQA)
    Convert

    Transform a value from one format to another (e.g. denary to floating-point), showing clear intermediate binary steps.

    Normalise

    Adjust mantissa bits to remove redundant leading bits (yielding 01 or 10) while decrementing or incrementing the exponent to preserve value.

    Explain

    Provide a coherent cause-and-effect rationale, such as explaining why allocating more bits to the exponent reduces precision.

    How Students Lose Marks (Examiner Pitfalls)
    Pitfall: Forgetting that the most significant bit (MSB) in two's complement fixed-point carries a negative weight.
    ❌ Weak Answer (Loses Marks):Converting 1101.0100 directly to denary by treating the first 1 as positive 8, giving 13.25.
    Example improved answer:In an 8-bit fixed-point format with 4 integer bits and 4 fractional bits, the weights are -2^3, 2^2, 2^1, 2^0, 2^-1, 2^-2, 2^-3, 2^-4. Thus 1101.0100 represents -8 + 4 + 1 + 0.25 = -2.75.
    Examiner Tip: Always write out your place-value column headings explicitly above the binary string, especially ensuring the leftmost column is negative.
    Pitfall: Incorrectly normalising negative floating-point numbers by aiming for '01' instead of '10'.
    ❌ Weak Answer (Loses Marks):Normalising a negative mantissa starting with 1110 to 0111 by inverting bits.
    Example improved answer:A normalised negative floating-point number in two's complement must start with 10. For mantissa 11.1000 and exponent 0011, shift the mantissa left by 1 position to obtain 10.0000, and decrement the exponent from 3 to 2 (0010) to preserve the value.
    Examiner Tip: Remember the golden rule of normalisation: positive mantissas begin with 01, and negative mantissas begin with 10.
    Step-by-Step Worked Solutions

    Question: A floating-point system uses a 6-bit two's complement mantissa and a 4-bit two's complement exponent. Normalise the unnormalised representation: Mantissa = 001011, Exponent = 0101 (binary for 5).

    1. 1.Step 1: Check the sign of the mantissa. The MSB is 0, so the number is positive. A normalised positive mantissa must begin with '01'.
    2. 2.Step 2: Determine the shift required. The mantissa is 001011. Shift left by 1 bit to make it 010110.
    3. 3.Step 3: Adjust the exponent to maintain equal value. Shifting the mantissa left by 1 multiplies it by 2, so the exponent must be decremented by 1.
    4. 4.Step 4: The original exponent is 0101 (+5 in denary). Decrementing by 1 gives 4, which is 0100 in 4-bit two's complement.
    Final Answer: Normalised Mantissa: 010110, Normalised Exponent: 0100

    Question: Convert the denary value -6.625 into an 8-bit two's complement fixed-point representation with a 5-bit integer part and a 3-bit fractional part.

    1. 1.Step 1: Represent the positive value +6.625 using 5 integer bits and 3 fractional bits. Integer 6 is 00110; fractional 0.625 is 0.5 + 0.125 = .101. Positive representation is 00110.101.
    2. 2.Step 2: Apply two's complement negation to find the negative equivalent. Invert all bits: 11001.010.
    3. 3.Step 3: Add 1 to the least significant bit (position 2^-3): 11001.010 + 00000.001 = 11001.011.
    4. 4.Step 4: Verify by calculating place values: -16 + 8 + 1 + 0.25 + 0.125 = -6.625.
    Final Answer: 11001011 (binary point implied between bits 3 and 4, representing 11001.011)
    Active Recall Memory Test
    What starting bit pattern indicates that a positive two's complement floating-point number is normalised?
    Key Fact: 01
    What is the primary advantage of increasing the number of bits allocated to the mantissa at the expense of the exponent?
    Key Fact: Increased precision (greater accuracy/more significant figures), at the cost of reduced dynamic range.
    Define the term 'underflow' in the context of floating-point representations.
    Key Fact: Underflow occurs when a calculation produces a non-zero magnitude that is too small to be represented by the minimum negative exponent.
    What formula is used to calculate relative error?
    Key Fact: Relative Error = |Absolute Error| / Actual Value (often expressed as a percentage by multiplying by 100).
    Frequently Asked Questions
    Why can computers not represent 0.1 accurately in floating-point binary?
    In base 10, 0.1 is 1/10, whose prime factors are 2 and 5. In base 2, only fractions whose denominators are powers of 2 (such as halves, quarters, eighths) can terminate cleanly. A fraction of 1/10 becomes an infinitely recurring binary fraction (0.0001100110011...), meaning it must be rounded or truncated to fit into a finite bit length.
    What is the difference between fixed-point and floating-point representations?
    Fixed-point representation maintains a static number of integer and fractional bits, meaning the position of the binary point never moves. This guarantees constant absolute precision and faster hardware arithmetic, but restricts the range of representable numbers. Floating-point allocates bits to a mantissa and an exponent, allowing the binary point to float, which provides a significantly larger dynamic range at the expense of variable absolute precision.
    How do you know whether to add or subtract from the exponent when normalising?
    Follow the balance rule: if you shift the mantissa to the left, you are multiplying the mantissa by powers of 2, so you must subtract that same number from the exponent to preserve the value. Conversely, if you shift the mantissa to the right (dividing it), you must add that number of shifts to the exponent.
    What happens when floating-point overflow occurs?
    Overflow occurs when a calculation produces a number with a magnitude too large to be represented within the available exponent and mantissa bits. In hardware, this sets an overflow status flag, and software may throw an exception or store a special value representing positive or negative infinity (or NaN).