Skip to content

9618 · 13.3

Floating-point numbers, representation and manipulation — practice questions

Practice and worked examples for 9618 Floating-point numbers, representation and manipulation. Short previews only — attempt the full question in MarkScheme against the official scheme.

Worked example 1

Represent the denary number 13.5 in normalised floating-point format using a 10-bit mantissa and a 6-bit exponent. Both should use two's complement.

Show solution outline
  1. Convert to Binary:
    • Integer part: 1310=8+4+1=1101213_{10} = 8 + 4 + 1 = 1101_2
    • Fractional part: 0.510=1/2=.120.5_{10} = 1/2 = .1_2
    • Combined: 13.510=1101.1213.5_{10} = 1101.1_2
  2. Normalise the Binary Number:
    • To make the mantissa start with '0.1', we must shift the binary point 4 places to the left: 1101.1.110111101.1 \rightarrow .11011
    • The number is positive, so the mantissa starts '0.1...'. This format is correct: 0.110110.11011.
  3. Determine the Exponent:
    • We shifted the point 4 places to the left, so the exponent is +4+4.
    • Convert 4 to 6-bit two's complement: 410=00010024_{10} = 000100_2.
  4. Format the Mantissa:
    • The normalised value is 0.110110.11011.
    • In a 10-bit two's complement format, we pad with zeros: 011011000020110110000_2.

Final Answer:

  • Mantissa: 0110110000
  • Exponent: 000100

Worked example 2

Represent the denary number -5.25 in normalised floating-point format using an 8-bit mantissa and a 4-bit exponent. Both should use two's complement.

Show solution outline
  1. Convert the positive equivalent to Binary:
    • First, consider +5.25.
    • Integer part: 510=4+1=10125_{10} = 4 + 1 = 101_2
    • Fractional part: 0.2510=1/4=.0120.25_{10} = 1/4 = .01_2
    • Combined: 5.2510=101.0125.25_{10} = 101.01_2
  2. Normalise the positive binary number:
    • Shift the binary point 3 places to the left: 101.01.10101101.01 \rightarrow .10101
    • The mantissa for +5.25 is 0.101010.10101.
  3. Determine the Exponent:
    • We shifted the point 3 places, so the exponent is +3+3.
    • Convert 3 to 4-bit two's complement: 310=001123_{10} = 0011_2.
  4. Format the Mantissa for the negative number:
    • First, write the positive mantissa in 8-bit form: 01010100201010100_2.
    • Now, convert to a negative number using two's complement:
      • Invert the bits: 10101011
      • Add 1: 10101100
    • This mantissa starts with '10', which is the correct normalised form for a negative number.

Final Answer:

  • Mantissa: 10101100
  • Exponent: 0011