Range and precision — AQA A-Level Computer Science
In AQA A-Level Computer Science, range refers to the difference between the smallest and largest representable numbers in a binary format, while precision denotes the level of detail or smallest step size between consecutive values. Allocating more bits to the exponent increases range, whereas allocating more bits to the mantissa increases precision within fixed-width floating-point representations.
Range and precision explained
Fixed point representation places the binary point at a set position, so every number uses the same number of bits for its integer and fractional parts.
Read the full explanation
This makes arithmetic simple and fast, but it limits the range of values that can be held and fixes the precision across that range. Floating point representation stores a number as a mantissa and an exponent, with the binary point effectively moving to suit the magnitude. This allows a much wider range of values, from very small to very large, and keeps precision roughly proportional to size. The cost is greater complexity in storage and arithmetic, and the need for hardware or software support to handle the exponent. When comparing the two, consider the range each can represent, the precision each offers across that range, and the speed and complexity of operations.
Your focus
- Compare the advantages and disadvantages of fixed point and floating point forms in terms of
Which command word is this?
Set out the cause and effect clearly. For example, explain how altering the exponent impacts range by detailing the wider power-of-two domain.
Range and precision exam tips
Topic Overview
Range and precision are fundamental attributes of numerical data representation in Computer Science, defining the spectrum and resolution of values a system can store. In AQA A-Level Computer Science, students must understand how fixed-point and floating-point systems divide available bits between representing magnitude and fractional detail.
Mastering this topic is essential for comprehending hardware limitations, rounding errors, and numerical instability. It connects directly to computer architecture, processor registers, and algorithm design, where engineers must select optimal data types to balance computational accuracy against memory overhead.
Key Concepts
- →Range is the difference between the minimum and maximum values representable within a specific binary format.
- →Precision is the degree of granularity or resolution representable, defined by the smallest distance between two consecutive values.
- →In floating-point representations, range is governed by the number of bits allocated to the exponent, while precision is dictated by the bits allocated to the mantissa.
- →Under a fixed bit-length constraint, an inherent trade-off exists: widening the exponent broadens range but truncates precision, and vice versa.
- →Normalization ensures maximum possible precision by shifting the mantissa so it starts with '01' (positive) or '10' (negative), eliminating redundant leading bits.
Marking Points
- Explains that fixed point has a limited range because the binary point is fixed.
- Explains that floating point offers a much wider range through its mantissa and exponent.
- Explains that fixed point gives uniform precision across its range.
- Explains that floating point precision varies with magnitude, being finer for small values.
- Identifies fixed point as simpler and faster to compute with, and floating point as more complex.
Examiner Tips
- 💡Structure your comparison around range and precision as separate points, then add speed and complexity.
- 💡Use a concrete example, such as a financial value versus a scientific measurement, to justify which form suits which context.
- 💡Keep statements specific: say what limits the range of fixed point and what determines the precision of floating point.
- 💡When asked to discuss trade-offs, state explicitly that the total bit budget is fixed; failing to mention this often caps your marks.
- 💡Show working by stating values of both mantissa and exponent in denary before computing the final power of two calculation.
- 💡Memorize the normalized patterns: positive mantissas always start with '01', and negative mantissas always start with '10'.
Common Mistakes
- States that floating point is always more precise, without noting that its precision depends on magnitude.
- Describes fixed point range as unlimited or treats both forms as having the same range.
- Gives advantages without linking them to range or precision as the statement requires.
- Thinking that adding more bits to the mantissa increases range: In reality, mantissa bits only refine fractional accuracy; only exponent bits extend range.
- Assuming fixed-point arithmetic maintains constant relative precision: Fixed-point formats have constant absolute precision (step size), but their relative precision worsens significantly for very small values.
- Believing that zero can be represented in normalized form: Zero is a special non-normalizable case because its mantissa cannot start with '01' or '10'.
Revision Plan
- 1Day 1-2: Review two's complement and practice converting fixed-point binary fractions to and from denary.
- 2Day 3-4: Master floating-point normalization rules for positive ('01') and negative ('10') values and determine boundary values.
- 3Day 5-6: Complete exam-style scenario questions evaluating the trade-off of shifting bits between mantissa and exponent.
- 4Day 7: Work through timed past paper questions covering underflow, overflow, and precision loss.
Exam Question Types
- 📋Boundary Calculations: Finding the minimum or maximum representable positive/negative values in a given format.
- 📋Format Comparison: Assessing the impact on range and precision when changing the bit division in a fixed-size word.
- 📋Error Identification: Explaining whether a computational error is due to overflow (exceeding range) or rounding/truncation (lacking precision).
Command Word Expectations (AQA)
Set out the cause and effect clearly. For example, explain how altering the exponent impacts range by detailing the wider power-of-two domain.
Show clear stages of working, convert binary components (mantissa and exponent) into denary, and provide the final value.
Identify both similarities and differences between two formats, directly contrasting their respective range and precision capabilities.
How Students Lose Marks (Examiner Pitfalls)
Step-by-Step Worked Solutions
Question: A computer system uses an 8-bit two's complement floating-point format with a 5-bit mantissa and a 3-bit exponent. Calculate the maximum positive value and the smallest positive non-zero value that can be represented in normalized form.
- 1.Step 1: Identify the bit allocation and sign requirements. The format uses 5 mantissa bits and 3 exponent bits. For normalized positive numbers, the mantissa must start with '01'.
- 2.Step 2: Find the maximum positive value. The mantissa should be maximized: 01111 in two's complement equals 0.5 + 0.25 + 0.125 + 0.0625 = 0.9375 (or 15/16). The exponent should be maximized as a positive 3-bit two's complement integer: 011 equals +3. Therefore, value = 0.9375 * 2^3 = 7.5.
- 3.Step 3: Find the smallest positive normalized value. The smallest positive normalized mantissa is 01000, which equals 0.5. The most negative 3-bit two's complement exponent is 100, which equals -4. Therefore, value = 0.5 * 2^-4 = 0.5 * 0.0625 = 0.03125 (or 1/32).
Question: Explain the effect on both the range and precision of representable numbers if a system modifies its 16-bit floating-point format from a 10-bit mantissa and 6-bit exponent to an 8-bit mantissa and 8-bit exponent.
- 1.Step 1: Analyze changes to the mantissa. The mantissa decreases from 10 bits to 8 bits. Fewer bits representing the fractional part means reduced resolution, leading to larger intervals between consecutive numbers and therefore decreased precision.
- 2.Step 2: Analyze changes to the exponent. The exponent increases from 6 bits to 8 bits. With two additional bits in two's complement, the exponent can represent powers from -128 up to +127 (previously -32 to +31), drastically increasing the magnitude span.
- 3.Step 3: Synthesize the impact on range and precision. The overall range of representable numbers is significantly increased (both very large and very small magnitudes can be stored), but the precision is reduced, increasing potential rounding errors.