Floating Point Workbench

Floating point, the OCR way

Mantissa and exponent, both in two's complement. Toggle the bits, type a number, then step through each conversion the way you would write it in the exam. A Level Computer Science, OCR H446, section 1.4.1 (e) and (f).

value = mantissa × 2exponent

Example with 8 and 4 bits: 0.1011000 × 20011 = 0.6875 × 8 = 5.5

Floating point number

Exam method

  1. Write the mantissa with its point after the first bit; write the exponent separately.
  2. First bit of the mantissa is the sign. If it is 1, find the two's complement to get the size of the number.
  3. Convert the exponent (two's complement) to denary.
  4. Move the point that many places: right for a positive exponent, left for a negative one.
  5. Add up the place values of the 1s (… 4, 2, 1, ½, ¼, ⅛ …).
  6. Put the sign back.

Worked conversion

Exam tips and common mistakes
Mantissa
The part of a floating point number that holds the significant digits. In OCR's form it is a two's complement fraction with the point after the sign bit.
Exponent
The power of two the mantissa is multiplied by; in effect, how far the point moves.
Normalised
A mantissa that starts 0.1 or 1.0, giving each value a single representation and the maximum number of significant bits.
Truncation
Dropping the bits that do not fit in the mantissa. The stored value is then slightly closer to zero than the true one.