Skip to content
Cambridge AS & A Level9618

Floating-point numbers, representation and manipulation

Computer Science 9618 Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Floating-point numbers, representation and manipulation notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Floating-point numbers, representation and manipulation notes as text: skim, search, and jump between subtopics.

~13 min read

1. Mantissa, exponent and bit allocation

A binary floating-point real number is stored as a mantissa and an exponent, both in two's complement form. The mantissa is a binary fraction with the binary point just after its sign bit. The exponent says how many places the binary point moves.

With a fixed total number of bits, the split matters. More bits for the mantissa gives more precision. More bits for the exponent gives a larger range of numbers. Gaining one costs the other.

The largest positive mantissa is `0` followed by all `1`s. The largest positive exponent is also `0` followed by all `1`s.

value = mantissa × 2^(exponent)

Worked example 12 marks

Describe the effect of changing the allocation of bits used for the mantissa and for the exponent in a floating-point number with a fixed total number of bits.

  1. 1

    When the number of bits in the mantissa is raised, the precision / accuracy of the number increases (lowered: it reduces) [1]

  2. 2

    When the number of bits in the exponent is increased, the range of numbers that can be represented increases (reduced: the range is reduced) [1]

2. Binary floating-point to denary

Read the exponent first. It is two's complement, so a leading `1` makes it negative. Then move the binary point of the mantissa that many places right (left if the exponent is negative).

The sign bit of the mantissa has place value −1. A mantissa that starts with `1` is a negative number, so the answer is negative.

Show the exponent, how you applied it, and the place values you added.

mantissa place values: -1, 1/2, 1/4, 1/8, …

Examiner insight

“Some candidates did give the final answer as a positive number instead of correctly identifying it as negative number.”

Worked example 13 marks

Normalised floating-point numbers are stored in a computer system using two’s complement for both the mantissa and the exponent with 11 bits for the mantissa and 5 bits for the exponent. Calculate the denary value of the given binary floating-point number. Show your working.

MantissaExponent
1 0 1 1 0 0 1 0 0 1 10 1 0 0 1
  1. 1

    exponent 01001 = 9, so the binary point moves 9 places [1]

  2. 2

    1.0110010011 × 2⁹ = 1011001001.1 (moving the binary point 9 places to the right) [1]

  3. 3

    -512 + 128 + 64 + 8 + 1 + 0.5 = -310.5 [1]

3. Denary to binary floating-point

Convert the number to binary. Move the binary point so that it sits just after the sign bit: the number of places moved is the exponent. Write the exponent in two's complement and pad the mantissa with zeros to its full length.

For a negative number, first write the positive mantissa. Then flip every bit and add 1. The exponent does not change.

Show each step: the binary conversion, the exponent, and the two's complement.

202 = 11001010₂ = 0.11001010 × 2⁸

Examiner insight

“Some candidates did not show sufficient working or made errors in the final answer.”

Worked example 13 marks

Real numbers are stored in a computer system using floating-point representation with 8 bits for the mantissa, 8 bits for the exponent, and two’s complement form for both mantissa and exponent. Write the normalised floating-point representation of –202 in this system. Show your working.

  1. 1

    +202 = 11001010, so 0.1100101 × 2⁸ and the exponent is 8 [1]

  2. 2

    mantissa: one's complement `10011010`, plus 1 gives `10011011` (the exponent does not change) [1]

  3. 3

    answer: mantissa `10011011`, exponent `00001000` [1]

4. Normalising a floating-point number

A normalised mantissa starts 01 (positive) or 10 (negative): its first two bits are different. If they are the same, shift the mantissa left until they differ.

Each place the mantissa moves left, subtract 1 from the exponent so the number keeps its value. Fill the gaps on the right with zeros.

Examiner insight

“Some candidates made errors in their calculation of the exponent.” “A smaller number of candidates gave the correct exponent.”

Worked example 13 marks

Real numbers are stored in a computer system using floating-point representation with 10 bits for the mantissa, 6 bits for the exponent and two’s complement form for both the mantissa and the exponent. The given binary floating-point number is not normalised. Normalise the floating-point number. Show your working.

MantissaExponent
0 0 0 0 0 0 0 1 1 11 0 0 1 1 1
  1. 1

    mantissa moved 6 places left, so 6 is taken from the exponent to keep the value: -25 - 6 = -31 [1]

  2. 2

    mantissa `0111000000` [1]

  3. 3

    exponent `100001` [1]

5. Why numbers are normalised

Normalisation maximises the number of significant bits, so the precision for the given number of bits is as high as it can be. It stops bits being wasted on leading zeros or ones.

It also lets a very large or very small number be stored with accuracy. And it means each number has only one representation, not many.

Worked example 13 marks

Explain the reason why binary numbers are stored in normalised form.

  1. 1

    to store the maximum range of numbers in the minimum number of bits [1]

  2. 2

    maximising the number of significant bits / maximising the potential precision for the given number of bits [1]

  3. 3

    avoids the possibility of many numbers having multiple representations [1]

6. Approximation and rounding errors

A binary representation can only be an approximation when the mantissa has too few bits. The least significant bits are truncated and precision is lost.

Some decimal fractions cannot be stored exactly at all. Binary place values are only 1/2, 1/4, 1/8, 1/16 and so on, so the stored value is the closest one available. The difference is a rounding error.

Name the numbers of bits: how many are needed and how many are available.

Examiner insight

“High marks were achieved by candidates who were specific in the number of bits available for the storage of the mantissa, in addition to including the consequence of the available mantissa size being too small.” “High marks were achieved by candidates who gave good explanations for the fact that not all fractional numbers can be accurately represented using binary, especially within the constraints of the given register.”

Worked example 13 marks

Numbers are stored in a computer using floating-point representation with 10 bits for the mantissa, 6 bits for the exponent, and two’s complement form for both the mantissa and the exponent. Describe the reason why the normalised form of the following binary number cannot be represented accurately using this system: 0101011.111001

  1. 1

    the mantissa of the number would need to be `0.101011111001`, that is 13 bits [1]

  2. 2

    it can only store 10 bits [1]

  3. 3

    the 3 least significant digits would be truncated, causing a loss of precision [1]

7. Overflow and underflow

Overflow occurs when a result is larger than the largest number the system can store. A larger exponent would be needed than the exponent bits allow.

Underflow occurs following an arithmetic operation when the result is too small to be represented in the available system.

largest, 12-bit mantissa and 4-bit exponent: (1 - 2⁻¹¹) × 2⁷ = 127.9375

Examiner insight

“Few candidates identified that these very small numbers were likely to be generated following a calculation.”

Worked example 13 marks

Numbers are stored in a computer system using binary floating-point representation with 12 bits for the mantissa, 4 bits for the exponent, and two’s complement form for both. Explain the problem that would occur if the two binary floating-point numbers representing the denary numbers 91.5 and 123.25 were added together and the result stored in the given system.

  1. 1

    the sum would be 91.5 + 123.25 = 214.75 [1]

  2. 2

    this exceeds the highest number that can be stored with an exponent of 7, which is 127.9375 [1]

  3. 3

    an exponent of 8 would be needed, so overflow would occur [1]

Recap

  • Floating-point real number = mantissa × 2 to the power of the exponent, both in two's complement.
  • More mantissa bits give more precision. More exponent bits give more range.
  • Binary floating-point to denary: read the exponent, move the binary point, add the place values. A leading 1 means negative.
  • Denary to binary floating-point: binary, move the point, exponent in two's complement. Negative: flip and add 1 to the mantissa only.
  • Normalised: the mantissa starts 01 or 10. Each shift left takes 1 from the exponent.
  • Normalising maximises precision and gives each number one representation.
  • Too few mantissa bits: the least significant bits are truncated, so precision is lost (a rounding error).
  • Overflow: a result is too large for the system. Underflow: a result is too small for the system.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. A 16-bit system changes from 12 mantissa and 4 exponent bits to 10 mantissa and 6 exponent bits. State the effect on the precision and on the range of numbers that can be stored.2 marks
    Answer
    1. Precision decreases, because the mantissa has fewer bits [1].
    2. Range increases, because the exponent has more bits [1].

    Trap: Mantissa bits set the precision and exponent bits set the range, but the two are often swapped.

  2. A system uses 8 bits for the mantissa and 4 bits for the exponent, both in two's complement. Calculate the denary value of the number below. Show your working. | Mantissa | Exponent | | --- | --- | | 0 1 0 1 1 0 0 0 | 0 0 1 1 |3 marks
    Answer
    1. Exponent 0011 = 3, so the binary point moves 3 places right [1].
    2. 0.1011000 × 2³ = 101.1 [1].
    3. 4 + 1 + 0.5 = 5.5 [1].

    Trap: Reading the mantissa as the whole number 88, or moving the binary point left instead of right.

  3. A system uses 10 bits for the mantissa and 6 bits for the exponent, both in two's complement. Calculate the denary value of the number with mantissa `1010100000` and exponent `000100`. Show your working.3 marks
    Answer
    1. Exponent 000100 = 4 [1].
    2. Mantissa 1.010100000, moved 4 places: 10101.0000 [1].
    3. -16 + 4 + 1 = -11 [1].

    Trap: Treating the leading 1 as a minus sign in front of 0.0101 gives −5. The sign bit has place value −1.

  4. A system uses 8 bits for the mantissa and 8 bits for the exponent, both in two's complement. Write +13.5 in normalised floating-point form. Show your working.3 marks
    Answer
    1. 13.5 = 1101.1 [1].
    2. Moving the binary point 4 places left gives 0.11011 × 2⁴ [1].
    3. Mantissa `01101100`, exponent `00000100` [1].

    Trap: Leaving off the leading 0 sign bit. Mantissa `11011000` would be a negative number.

  5. A system uses 10 bits for the mantissa and 6 bits for the exponent, both in two's complement. Calculate the normalised floating-point representation of −5.375. Show your working.4 marks
    Answer
    1. 5.375 = 101.011, so 0.101011 × 2³ and the exponent is `000011` [1].
    2. Positive mantissa `0101011000` [1].
    3. Flip the bits: `1010100111`, then add 1: `1010101000` [1].
    4. Answer: mantissa `1010101000`, exponent `000011` [1].

    Trap: Flipping the bits but not adding 1, or only changing the sign bit to 1 (`1101011000`).

  6. A system uses 10 bits for the mantissa and 6 bits for the exponent, both in two's complement. The number with mantissa `0001101000` and exponent `000101` is not normalised. Normalise it and show that its value is unchanged.3 marks
    Answer
    1. The first two bits of the mantissa are the same, so shift it 2 places left: `0110100000` [1].
    2. Exponent 5 - 2 = 3, which is `000011` [1].
    3. Check: 0.001101 × 2⁵ = 6.5 and 0.1101 × 2³ = 6.5 [1].

    Trap: Adding 2 to the exponent (`000111`) instead of subtracting makes the value 16 times too big.

  7. A system uses 8 bits for the mantissa and 4 bits for the exponent, both in two's complement. The number 6 can be stored as mantissa `00110000` with exponent `0100`, or as mantissa `01100000` with exponent `0011`. (a) Show that both represent 6. (b) Explain which is the normalised form and why normalised form is used.5 marks
    Answer
    1. (a)
    2. 0.011 × 2⁴ = 0.375 × 16 = 6 [1].
    3. 0.11 × 2³ = 0.75 × 8 = 6 [1].
    4. (b)
    5. The second is normalised, because its first two bits are different [1].
    6. The first wastes a bit on a leading zero, so fewer significant bits are stored and precision is lower [1].
    7. Normalising also gives each number only one representation [1].

    Trap: Saying normalising saves memory. The total number of bits is the same; it maximises the significant bits.

  8. A system uses 8 bits for the mantissa and 8 bits for the exponent, both in two's complement. The number 37.8125 is stored in normalised form. Explain what is stored and work out the error.4 marks
    Answer
    1. 37.8125 = 100101.1101, so 0.1001011101 × 2⁶ [1].
    2. This needs 11 mantissa bits (with the sign bit) but only 8 are available [1].
    3. Stored: mantissa `01001011`, exponent `00000110`. The last 3 digits are truncated [1].
    4. Stored value = 100101.1 = 37.5, so the rounding error is 37.8125 - 37.5 = 0.3125 [1].

    Trap: Thinking the 8 exponent bits make up for the short mantissa. Precision depends on the mantissa only.

  9. A data logger stores normalised readings with 8 bits for the mantissa and 4 bits for the exponent, both in two's complement. (a) Write the smallest positive number that can be stored, as a mantissa and an exponent, and give its denary value. (b) A reading of 0.03125 is divided by 64 and the result is stored. Explain the problem that occurs.6 marks
    Answer
    1. (a)
    2. Smallest normalised positive mantissa is `01000000`, which is 0.5 [1].
    3. Most negative exponent is `1000` = -8 [1].
    4. 0.5 × 2⁻⁸ = 2⁻⁹ = 0.001953125 [1].
    5. (b)
    6. 0.03125 ÷ 64 = 2⁻⁵ ÷ 2⁶ = 2⁻¹¹ [1].
    7. Normalised, this is 0.1 × 2⁻¹⁰, so an exponent of -10 is needed but the smallest is -8 [1].
    8. Underflow occurs: following an arithmetic operation, the result is too small to be represented in the system [1].

    Trap: Taking `0000` or `1111` as the smallest exponent and not linking underflow to the calculation; examiners reported few candidates saw that underflow follows a calculation.

  10. A freezer's temperature logger uses 10 bits for the mantissa and 6 bits for the exponent, both in two's complement. A reading is stored as mantissa `1110100000` with exponent `000110`. (a) State why the number is not normalised. (b) Normalise it. (c) Calculate its denary value. (d) A student keeps shifting the mantissa until it starts `01`. State the value the student's number represents.6 marks
    Answer
    1. (a)
    2. The first two bits of the mantissa are the same [1].
    3. (b)
    4. Shift the mantissa 2 places left: `1010000000` [1]. Exponent 6 - 2 = 4, so `000100` [1].
    5. (c)
    6. Mantissa 1.010000000 = -1 + 0.25 = -0.75 [1].
    7. -0.75 × 2⁴ = -12 [1].
    8. (d)
    9. Three shifts give mantissa `0100000000` with exponent `000011`: 0.5 × 2³ = +4, the wrong sign and value [1].

    Trap: A negative mantissa is normalised when it starts 10; shifting on until it starts 01 turns it positive, the error examiners reported as a final answer with the wrong sign.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
the final answer is 78.25 (the sign bit is ignored)a mantissa starting with `1` is negative, so the answer is −78.25
the exponent stays the same after the mantissa is shifted leftsubtract the number of places shifted from the exponent
the number does not fit, so accuracy is lostthe mantissa needs 13 bits but has 10 bits, so the 3 least significant digits are truncated
underflow is when a number is too smallunderflow occurs following a calculation, when the result is too small to be represented in the system

Frequently asked questions

What is the effect of changing the number of bits for the mantissa and the exponent?
More mantissa bits increase the precision of the number. More exponent bits increase the range of numbers that can be represented. With a fixed total number of bits, gaining one costs the other.
How do you convert a binary floating-point number to denary?
Read the exponent first, because a leading 1 makes it negative. Move the binary point of the mantissa that many places right, or left if the exponent is negative. A mantissa that starts with 1 is negative, because the sign bit has place value -1. Show the place values you add.
How do you normalise a floating-point number?
A normalised mantissa starts 01 for a positive number or 10 for a negative number. If the first two bits are the same, shift the mantissa left until they differ. Subtract 1 from the exponent for each place moved, so the number keeps its value.
Why are binary floating-point numbers normalised?
Normalisation maximises the number of significant bits, so precision is as high as it can be for the bits available. It also means each number has only one representation.
Why can a binary floating-point number be only an approximation?
A binary representation is only an approximation when the mantissa has too few bits. The least significant bits are truncated and precision is lost. Some decimal fractions cannot be stored exactly, so the stored value is the closest one available, and the difference is a rounding error.
Is a positive final answer correct when the mantissa starts with 1?
No. A mantissa that starts with 1 is negative, so the answer is negative. Examiners reported candidates giving a positive number, such as 78.25, when the sign bit should be counted. The sign bit has place value -1.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters