retagged by
4,490 views
4 votes
4 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$ 
retagged by

5 Answers

11 votes
11 votes
question is asked for 5 bits signed value
A is having 01010=10 in decimal
B is having 11010=-6 in decimal
Now A+B is 4 which is 00100, hence no overflow
Now A-B is 16 which is 010000, see that we used 6 bits hence it is overflow
Now B-A is -16 which is 10000, hence no overflow
Now 2*B is -12 which is 10100, hence no overflow

hence our correct option will be option B
2 votes
2 votes

 In 2 's complement system change use $2's$ $complement$ iff MSB is 1 else use plain binary 



 

1 votes
1 votes

The range of signed 2's complement numbers with 5 bits is -16 to 15. Any operation that produces a result that is out of the bounds of this range will cause an overflow. given A = 10 (01010) and B = -6 (11010), by doing A - B the value equates to 16 which is out of the bound of the range that is supported by 5 bit numbers and hence causes overflow 

0 votes
0 votes

As we know the range of 2's complement number is $-2^{n-1} \text{ to } (2^{n-1} -1)$ because the given data is five-bit long so its range is $-16 $ to $+15.$ 

First calculate the value of $A, B$.

  • $A=01010=+10$ as the MSB bit is zero so the number is positive.
  • $B=11010=-2+4-8=-6$ as MSB bit is one so the number is negative.

Option A) $A+B= +10+(-6)=+4$

Option B) $A-B= +10-(-6)=+16$.To represent $(+16)_{10}\rightarrow (010000)_2$ it required total of six bits which is clearly out of range.

Option C) $B-A=-6-(+10)=-16$

Option D) $2*B=2*(-6)=-12$

So Option $(B)$ is correct.

Answer:

Related questions

2.8k
views
1 answers
3 votes
Arjun asked Feb 16
2,789 views
​​Consider the circuit shown below where the gates may have propagation delays. Assume that all signal transitions occur instantaneously and that wires have no delays...
2.4k
views
2 answers
1 votes
Arjun asked Feb 16
2,351 views
Consider a Boolean expression given by $\text{F(X, Y, Z)}=\sum(3,5,6,7)$.Which of the following statements is/are CORRECT?$\text{F(X, Y, Z)}=\Pi(0,1,2,4)$ $\text{F(X, Y, ...
2.6k
views
3 answers
2 votes
Arjun asked Feb 16
2,578 views
Consider a digital logic circuit consisting of three $2$-to-$1$ multiplexers $\text{M1, M2}$, and $\text{M3}$ as shown below. $\mathrm{X} 1$ and $\mathrm{X} 2$ are inputs...
3.4k
views
1 answers
5 votes
Arjun asked Feb 16
3,355 views
Consider the following sample of numbers:$9,18,11,14,15,17,10,69,11,13$The median of the sample is$13.5$$14$$11$$18.7$