Revise Computingrevisecomputing.co.uk
Free student revisionSee questionsFor schoolsSchool enquiry
Free revisionSee questionsFor schoolsSchool enquiry
Knowledge/A Level/H446/01 Computer systems/Data Types/Representation and normalisation of floating…

Representation and normalisation of floating point numbers in binary

Representation and normalisation of floating point numbers in binary.

1.4.1 Data Types

Data Types — Note 7 of 10

Candidates should have an understanding of how (positive and negative) real numbers are represented in a binary floating-point representation, and should be able to convert between a denary number and a real binary number. (NB the representation used for the exam is the mantissa and exponent both represented using two’s complement.) Candidates should understand the need for normalised floating point numbers. Candidates should be able to normalise a floating point number.

What you need to know

Floating point represents real numbers using a mantissa and an exponent, like standard form in maths. In the OCR exam, both the mantissa and the exponent are stored in two's complement. Numbers are normalised to give the greatest possible precision.

What to know

  • To convert to denary: work out the exponent, move the binary point in the mantissa that many places, then read the value using two's complement place values.
  • A normalised POSITIVE number starts 0.1; a normalised NEGATIVE number starts 1.0.
  • To normalise: shift the mantissa left until the first two bits differ, and subtract the number of places shifted from the exponent.
  • Trade-off: more mantissa bits give greater PRECISION; more exponent bits give a greater RANGE of values.

Key terms

Exam tipCommon mistake

Mantissa

The part of a floating point number holding its significant digits. In OCR exams it is a two's complement fixed point number with the binary point after the first bit.

  • Mantissa place values (with the point after the first bit): -1 . 1/2 1/4 1/8 1/16 ....
Exponent

A two's complement integer saying how many places to move the binary point: right if positive, left if negative.

  • Common mistake: Moving the binary point the wrong way. A positive exponent moves the point to the RIGHT (making the number bigger).
Normalisation

Adjusting the mantissa and exponent so the mantissa uses as many significant bits as possible, maximising precision for the number of bits available.

  • Normalisation also ensures each number has only one representation.

Exam technique

  • Tip:Always convert the exponent first, and check whether the mantissa is positive or negative by looking at its first bit.

Code examples

Floating point examples (8-bit mantissa, 4-bit exponent)
text
Positive: mantissa 0.1010000, exponent 0011 (= 3)
  move point 3 right: 0101.0000 = 4 + 1 = 5

Negative: mantissa 1.0110000, exponent 0010 (= 2)
  move point 2 right: 101.10000
  = -4 + 1 + 0.5 = -2.5

Normalising: mantissa 0.0011000, exponent 0101 (= 5)
  shift mantissa left 2 places -> 0.1100000
  exponent 5 - 2 = 3 -> 0011
  value unchanged: 6
← Previous noteConvert positive integers between binary, hexadecimal and denary1.4.1 Data TypesNext note →Floating point arithmetic: addition and subtraction1.4.1 Data Types

Back to Data Types

Data Types

Note 7 of 10

  1. 1Primitive data types: integer, real/floating point, character, string and Boolean
  2. 2Represent positive integers in binary
  3. 3Sign and magnitude and two's complement to represent negative numbers
  4. 4Addition and subtraction of binary integers
  5. 5Represent positive integers in hexadecimal
  6. 6Convert positive integers between binary, hexadecimal and denary
  7. 7Representation and normalisation of floating point numbers in binary
  8. 8Floating point arithmetic: addition and subtraction
  9. 9Bitwise manipulation and masks: shifts, combining with AND, OR and XOR
  10. 10How character sets (ASCII and UNICODE) are used to represent text
Topic overview