The GATE Grind

GATE 2024 CS (CS1) – Question 13

Computer Organization and Architecture · Number Representation and Floating Point Arithmetic · 1 mark · Multiple choice

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?

  1. $A+B$
  2. $A-B$
  3. $B-A$
  4. $2*B$

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.