5.4. Binary Number System - Concise
5.4. Binary Number System - Concise
www.pmt.education
Specification:
www.pmt.education
4.5.4.6 Absolute and relative errors:
Be able to calculate the absolute error of numerical data stored and
processed in computer systems.
Be able to calculate the relative error of numerical data stored and
processed in computer systems.
Compare absolute and relative errors for large and small magnitude
numbers, and numbers close to one.
www.pmt.education
Signed and unsigned binary
1. 0 +
0 + 0 = 0
2. 0 +
0 + 1 = 1
3. 0 +
1 + 1 = 10
4. 1 + 1 + 1 = 11
● After carrying out binary addition, it’s a good idea to check your answer by
converting to decimal if you have time
www.pmt.education
Signed binary with two’s complement
● Two’s complement allows for the representation of both positive and negative
numbers in binary
● The most significant bit of a number is given a negative place value
www.pmt.education
Floating point binary (decimal to binary)
● First convert your decimal number to fixed point binary
● Next, normalise the number so that it starts with 01(for a positive number) or 10
(for a negative number)
● When converting from floating point to decimal, the binary point is assumed to be
between the first two digits in the mantissa. Move the binary point until this is
achieved.
● The number of positions through which the binary point is moved forms the
exponent, which must be converted to binary
● Combine the mantissa and exponent to form a normalised floating point number
Rounding errors
● There are some decimal numbers that cannot possibly be represented exactly in
binary
● Binary can only approximately represent these numbers
● For this reason, both fixed point and floating point representations of decimal
numbers may be inaccurate
● You can calculate absolute and relative errors to see how close a particular number
is to an actual value
absolute error
relative error = actual value
www.pmt.education
Errors in relation to magnitude
● An absolute error of 0.1cm in a measurement of 50m results in a very small relative
error of 0.002%
● The same absolute error of 0.1cm in a measurement of 1cm results in a much
larger relative error of 10%
● Both fixed point and floating point perform the same function of representing
numbers with fractional parts in binary
● Floating point allows for the representation of a greater range of numbers with a
given number of bits than fixed point
● The number of bits allocated to each part of a floating point number affects the
numbers that can be represented
○ A large exponent and a small mantissa allows for a large range but little
precision
○ A small exponent and a large mantissa allows for good precision but only a
small range
● The placement of the binary point in fixed point notation determines the range and
precision of the numbers that can be represented
○ A binary point close to the left of a number gives good precision but only a
small range of numbers
○ A binary point close to the right gives good range but poor precision
Normalisation
● Floating point numbers are normalised to provide the maximum level of precision
for a given number of bits
● Involves ensuring that the a floating point numbers starts with 01(for a positive
number) or 10(for negative numbers)
www.pmt.education
Underflow and overflow
● Two types of error that can occur when working with binary
Underflow
● Occurs when very small numbers are to be represented but there are not enough
bits available
Overflow
● Occurs when a number is too large to be represented with the available bits
● Particularly important when using signed binary where overflow can cause positive
numbers to give negative results
www.pmt.education