Range, precision, underflow and representation decisions
By UK A Level Computer Science · independent study · myAudience

Original generated teaching illustration, built-in imagegen,2026-10-04; mathematical model,not documentary photograph. · Original generated artwork; operator provenance/rights and independent scientific acceptance pending.
Range, precision, underflow and representation decisions
A representation decision must compare defined formats under a shared storage budget. Here both use ten bits: a signed fixed-point integer with four fractional positions, or the simplified six-bit mantissa/four-bit exponent format restricted to normalised nonzero values plus canonical zero. We do not import IEEE subnormal, infinity or NaN encodings. The second format's normalization constraint matters: removing it would admit additional tiny raw-field values and change the range claims. State that accepted set before calculating extrema.
For the fixed format, scale a ten-bit two’s-complement integer by 1/16. Integer range −512..511 gives values −32..31.9375 and constant step 1/16. Its positive and negative extrema are not symmetric because zero occupies a nonnegative code. For the simplified float, positive normalised raw mantissas 16..31 and negative ones −32..−17 are combined with exponent −8..7. Maximum positive is 31/32×128=124; most negative is −1×128=−128. These are exact extrema under this format, not an industrial float specification.
The smallest positive normalised value is 16/32×2^(−8)=1/512. The negative value closest to zero is −17/32×2^(−8)=−17/, not −1/512. Positive and negative sets are asymmetric; the minimum negative magnitude requires the least-magnitude allowed negative mantissa, not simply negating the positive minimum. The raw pattern −0.5 would have prefix 11 and must normalise to −1 with a smaller exponent. At the minimum exponent that normalisation is unavailable, explaining the gap rather than treating it as an arithmetic contradiction.
Spacing within a mantissa interval at exponent e is 2^e/32. At exponent 3 this is 1/4, larger than fixed spacing 1/16. At exponent 0 it is 1/32, smaller. Thus fixed point offers uniform absolute resolution while this float changes absolute resolution with scale. Relative precision is generally the more useful scale comparison for normalised values, but it is not a reason to assume exact fractions or equal positive and negative error properties. At a boundary, available neighbouring values and the rounding policy must be examined directly.
Overflow means that a desired result exceeds the accepted range, such as positive 130 in the floating model or positive 40 in the fixed model. Under-range for a nonzero magnitude means no suitable normalised value at that small scale, as with positive 0.001 here. Returning zero, rejecting, or rounding to a permitted nonzero neighbour are different contracts and may have large relative errors. This lesson does not prescribe anIEEE exception flag or hidden subnormal route. The response must be specified and disclosed to the caller, not smuggled into a successful-looking result.
For a fictional measurement set from −20 to 20 requiring absolute conversion error no greater than 0.04, fixed point's nearest rounding half-step 1/32=0.03125 satisfies the stipulated bound and range. The simplified float at values near 20 uses exponent 5, with local spacing 1 and possible nearest error up to 0.5, so it cannot provide that general guarantee. A particular input 20 can be exact while neighbouring permitted inputs fail the tolerance. Testing only an exact integer therefore gives misleading confidence about the full domain.
Conversely, a fictional set including 100 cannot fit the ten-bit fixed format. The simplified float represents 100 exactly as 25/32×128, with mantissa 011001 and exponent 0111, though its local spacing at that scale is 4. If the requirement is broad range with moderate relative tolerance, this may be preferable. Speed comparisons require an implementation model: a scaled integer can use simpler arithmetic in one environment while dedicated floating hardware changes costs in another. Neither the lesson's field diagram nor Python timing proves a universal performance ranking.
Reading the diagram: The plate uses separate bound cards instead of pretending that differently scaled number-line intervals have equal lengths. It explicitly names the normalised-only contract, zero handling and closest-negative asymmetry. Its spacing examples use a stated exponent and do not claim a uniform float quantum. An evaluated transfer answer should derive ranges, test demanding nonexact inputs, budget conversion and subsequent arithmetic errors, and justify a failure vocabulary. Qualification-level fluency still requires further unfamiliar conversion/normalisation tasks and representation applications; this bounded slice does not close all assessed demands.
Worked example: Compare equal 10-bit formats: signed fixed with 4 fractional bits versus the normalised 6+4 simplified float. Derive both ranges and float near-zero asymmetry.
Fixed values are signed integers −512..511 divided by 16, giving −32..31.9375; step 1/16.
Float extrema: 31/32×2^7=124 and −32/32×2^7=−128.
Least positive normal=16/32×2^(−8)=1/512; closest negative=−17/32×2^(−8)=−17/. Zero is a separate canonical pair.
Answer: Float offers broader magnitude range with scale-dependent spacing; fixed offers uniform 1/16 spacing. Neither has symmetric signed bounds or universal superiority.
Check your understanding: Choose between these formats for −20..20 with error≤0.04 and for a dataset including 100. Supply a nonexact counterexample to a claim that float always has enough precision near 20. Define outcomes for 130 and 0.001 without importingIEEE special values.
Answer: Nearest-rounded fixed point covers −20..20 with error≤1/32=0.03125. Float around 20 has exponent 5 and step 1, so 20.4 rounds to 20 under nearest policy and has error 0.4>0.04; exact 20 alone was not adequate testing. Fixed cannot represent 100, while float encodes 100 as 011001/0111, with step 4 at that scale. Choosing it for the second dataset requires an appropriate tolerance. Desired 130 exceeds float positive maximum 124; 0.001 is below smallest positive normal 1/512. Return distinct overflow and under-range outcomes, or a documented lossy rounding policy with its error. Neither is anIEEE infinity/NaN/subnormal convention in this contract.
Why: Require equal-budget derivations, negative asymmetry, a nonexact precision counterexample and a justified range-versus-tolerance decision. A valid application judgement must include subsequent arithmetic and failure handling, not just a successful encoding of one convenient value.