Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a) An overflow occurs when the result of adding two number islarger than can be

ID: 1829957 • Letter: A

Question

a) An overflow occurs when the result of adding two number islarger than can be represented. for example, two 4-bit signednumbers will cause an overflow if their result is greater than +7or less than -8. For example, the following additions will cause anoverflow because their results are outside the range. So, if4-bit addition is performed on these numbers, what will the resultbe interpreted as?
6+6      -7+-3

b) How can someone detect an overflow condition during a 4-bitaddition by examining the sign bits of the two inputs and theresult?

Explanation / Answer

a) 6 + 6 =12 but 12 cannot be represented in 4 bits. SO the result will be-4 due to the overflow 6 in binary = 0110 0110 + 0110 = 1100 1100 is -4 in binary -7 = 1001 -3 = 1101 1001 +1101 = 0110 and overflow is ignored. 0110 is +6 in binary . So the result will be +6 due to oveflow. b) While adding, the numbers are assumed to be of thesame sign . If the signs are different, then it is calledsubtraction. So, if the result has the same sign bit as the 2 numbers whichwere added, then there has been no overflow. If the result has a different sign bit from the 2 numbers,then an overflow has occured. I hope this helps you