Loading...
A floating-point value combines a signed mantissa with a power-of-two scale. Decode each field using its own rules before combining them.
What you'll be able to do
AQA questions use a simplified binary floating-point format with both mantissa and exponent in two’s complement. The binary point in the mantissa is normally specified after its sign bit. Interpret the mantissa as a signed fraction and the exponent as a signed integer, then calculate mantissa×2^exponent.
This is not an instruction to memorise the IEEE representation with biased exponents, hidden leading bits and special encodings. Follow the supplied field widths and point position. In this lesson’s examples, the mantissa has eight bits and the exponent four bits.
For mantissa 0.1011000, the value is 1/2+1/8+1/16=0.6875. Exponent 0011 means +3, giving 0.6875×8=5.5. A negative mantissa’s sign bit has weight -1, so 1.0100000 represents -0.75 rather than -0.25.
A negative exponent divides the mantissa by a power of two. Exponent 1110 in four-bit two’s complement is -2, so a mantissa of 0.5 gives 0.125. Do not use the mantissa’s fractional weights when decoding the integer exponent.
An exponent supports values across a wider range of scales than the same total width devoted to a fixed-point grid. More mantissa bits generally improve significant precision; more exponent bits generally improve available scale range. Changing the allocation trades these properties within a fixed total width.
Fixed-point spacing is uniform, while floating-point spacing changes with exponent. Neither representation stores all real values exactly. Calculation speed depends on the hardware and implementation, so a simplistic claim that one format is always faster on every system is unreliable; use the context and assumptions supplied.
| 8-bit mantissa | 4-bit exponent | Value |
|---|---|---|
| 0.1011000 | 0011 | 5.5 |
| 1.0100000 | 0010 | -3 |
| 0.1000000 | 1110 | 0.125 |
Attempt the task before opening its worked response. Record each change of state, explain the rule used, and check the result against the original requirements. Code examples labelled Python 3 use that language’s conventions; pseudocode states its own assumptions.
Common mistakes to avoid
Key takeaways
Test yourself
Answer a few questions, then review anything you missed.
Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.