GCSE COMPUTING
NUMBER
THEORY6. Overflow errors
On the previous page we added two binary numbers together and got a straightforward result:
Col 1 |
Col 2 |
Col 3 |
Col 4 |
Col 5 |
Col 6 |
Col 7 |
Col 8 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
|
1 |
0 |
1 |
1 |
1 |
0 |
0 |
0 |
Now what would happen is the 8th digit sum is 1 + 1? The carried 1 has nowhere to go and so is lost.
This problem is called 'overflow' and it causes the wrong answer.
This is the same as if you are not allowed to have a decimal number greater than 255 because of a computer limit but the software is trying to add 249 + 21. This is 270 but since the system cannot deal with numbers larger than 255 an overflow occurs.
Overflow is such a problem in a CPU that a special 'flag' inside the CPU is set when it happens. The software carrying out the maths should read this flag to see if an overflow has occured. If it has then it has to deal with the problem.
Challenge see if you can find out one extra fact on this topic that we haven't already told you
Click on this link: Overflow Errors
Copyright © www.teach-ict.com


