in Digital Logic edited by
3,442 views
2 votes
2 votes

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$ 
in Digital Logic edited by
by
3.4k views

5 Answers

0 votes
0 votes

We have 5 bits in 2's complement form.

Therefore our range of numbers will be : 10000 = (-16) + 0 + 0 + 0 + 0 = -16 (smallest)

to 01111 = 0 + 8 + 4 + 2 + 1 = 15 (largest)

Now just check the options and mark the one which will not result in the range.

We have A  = 01010 (10 in decimal)  B = 11010 (-6 in decimal)

Option 1: A + B = 10 + (-6) = 4 (in range)

Option 2: A - B = 10 - (-6) = 16 ( not in range) [ANSWER]

Option 3: B - A = -6 - (10) = -16 (in range)

Option 4: 2*B = 2*(-6) = -12 (in range)

Answer:

Related questions