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
- 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
- 1Day 1: Master two's complement fixed-point conversions both to and from denary, practicing with varying binary point positions.
- 2Day 2: Practice converting denary real numbers into unnormalised and normalised floating-point formats with given mantissa and exponent lengths.
- 3Day 3: Focus on negative floating-point numbers, ensuring full fluency with the '10' leading bit pattern rule.
- 4Day 4: Work through exam questions calculating absolute and relative errors caused by truncation and rounding.
- 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)
Transform a value from one format to another (e.g. denary to floating-point), showing clear intermediate binary steps.
Adjust mantissa bits to remove redundant leading bits (yielding 01 or 10) while decrementing or incrementing the exponent to preserve value.
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)
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.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.Step 2: Determine the shift required. The mantissa is 001011. Shift left by 1 bit to make it 010110.
- 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.Step 4: The original exponent is 0101 (+5 in denary). Decrementing by 1 gives 4, which is 0100 in 4-bit two's complement.
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.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.Step 2: Apply two's complement negation to find the negative equivalent. Invert all bits: 11001.010.
- 3.Step 3: Add 1 to the least significant bit (position 2^-3): 11001.010 + 00000.001 = 11001.011.
- 4.Step 4: Verify by calculating place values: -16 + 8 + 1 + 0.25 + 0.125 = -6.625.