GATE 2024 CS (CS1) – Question 13
Consider a system that uses 5 bits for representing signed integers in 2's complement format. In this system, two integers $A$ and $B$ are represented as $A$=01010 and $B$=11010. Which one of the following operations will result in either an arithmetic overflow or an arithmetic underflow?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) $A-B$
Explanation
A=10, B=−6. Range is −16 to 15. A+B=4, B−A=−16, 2B=−12 all fit. A−B=16 exceeds 15, so overflow.