Let and be two registers that store numbers in complement form. For the operation which one of the following values of and gives an arithmetic overflow?
View worked solution
Answer: B
For a -bit register storing numbers in ’s complement form, the range of representable integers is:
An arithmetic overflow occurs during addition if the mathematical sum of the two numbers falls outside this representable range . Alternatively, overflow occurs when adding two numbers of the same sign yields a result with the opposite sign.
Let us evaluate each option by converting the ’s complement binary numbers to their decimal equivalents:
- Option A:
- (within range , no overflow)
- Option B:
- (outside range , overflow occurs)
- Option C:
- (within range , no overflow)
- Option D:
- (within range , no overflow)
Thus, only the values in Option B result in an arithmetic overflow.
Free practice · Your answers on this page are not saved.
