Binary Addition and Overflow
Binary - Basic Principles |
There are 4 rules for carrying out addition of two binary digits these are: Â 0 + 0 = 0 0 + 1 = 1Â 1 + 0 = 1 1 + 1 = 0 carry 1 but 1 + 1 + 1 = 1 carry 1
 There are 8 rules for carrying out addition of three binary digits these are:  0 + 0 + 0 = 0 0 + 0 + 1 = 1 0 + 1 + 0 = 1 0 + 1 + 1 = 0 carry 1 1 + 0 + 0 = 1 1 + 0 + 1 = 0 carry 1 1 + 1 + 0 = 0 carry 1 1 + 1 + 1 = 1 carry 1
Add 01011011 + 00111010Â (91 + 58)
Answer: 10010101 = 149 |
 Â
Task 1 |
Add up the following pairs of binary numbers. Use the table below to help.
0110 Â + 0101 = 1011 = 11 0101 Â + 0101 = 1010 = 10 1011 Â + 1110Â =Â 11001 = 25 1001 + 0110Â = 1111 = 15 1010 + 1011Â =Â 10101 =21 1111 + 1001 = 11000 = 24 0110 + 0101=Â 1011 = 11
0 + 0 = 0 0 + 1 = 1Â 1 + 0 = 1 1 + 1 = 0 carry 1 but 1 + 1 + 1 = 1 carry 1
|
   Â
8 Bit numbers |
8 bit numbers follow exactly the same rule set as 4 bit numbers, the difference being that you can work with values up to 255. |
Task 3 |
Add up the following pairs of 8 bit binary numbers. Use the table below to help. Carry | | 1 | 1 | | | 1 | 1 | 0 | Check | | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | | + | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | |
|
01001110 + 00111100 = 1001010Â 10011101 + 10001111 = 10010110 11010011 + 01010110 = 100101011 10010011 + 10111001 =Â 101001100 11111110 + 10110101 = 110110011 = 507 10111101 + 11100111 = 110100100 = 420
0 + 0 + 0 = 0 0 + 0 + 1 = 1 0 + 1 + 0 = 1 0 + 1 + 1 = 0 carry 1 1 + 0 + 0Â = 1 1 + 0 + 1 = 0 carry 1 1 + 1 + 0 = 0 carry 1 1 + 1 + 1 = 1 carry 1
|
Adding three binary numbers |
To add three binary numbers, add the first two, and then add the third to the result. E.g to add the three binary numbers 00101100, 00010001 and 10000101: 00101100 00010001 + 00111101  10000101 + 11000010 |
Overflow |
Overflow occurs when the result of adding two binary numbers is greater than the number of bits allowed. The maximum value that can be held in an 8-bit register is 255.  The computer would need 9 bits to represent 332 so this 9th bit doesn’t fit in the byte allocated. Which is an overflow error. |
Questions |
Add the following binary numbers, leaving the answer as binary numbers. 00111011 + 10000110Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â [1]
011000001 10011100 + 01111110 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â [1]
0100011010 00110011 + 01000110 Â Â Â [1]
01111001 00011100 + 01110011 + 01001101 Â Â Â [1]
011011100 Explain the problem that would occur in part 1(b) if the result was to be stored as an 8-bit number.           It would be classed as an overflow                           [2]
|