Floating point arithmetic, positive and negative numbers, addition and subtraction
1.4.1 Data Types
Data Types — Note 8 of 10
Candidates should be able to perform addition and subtraction floating point arithmetic including addition and subtraction of both positive and negative numbers.
To add or subtract floating point numbers, their exponents must first be made the same so that the binary points line up. The mantissas are then added (or subtracted using two's complement) and the result is normalised.
5 = 0.1010000 x 2^3
1.5 = 0.1100000 x 2^1 -> shift mantissa right 2: 0.0011000 x 2^3
0.1010000
+ 0.0011000
= 0.1101000 x 2^3
Already normalised (starts 0.1): 0110.1 = 6.5