edited by
13,780 views
39 votes
39 votes

When two $8\text{-bit}$ numbers $A_{7}\cdots A_{0}$ and $B_{7}\cdots B_{0}$ in $2$'s complement representation (with $A_{0}$ and $B_{0}$ as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are $S_{7}\cdots S_{0}$ and the carry bits are $C_{7}\cdots C_{0}$. An overflow is said to have occurred if

  1. the carry bit $C_{7}$ is $1$
  2. all the carry bits $\left ( C_{7},\cdots ,C_{0} \right )$ are $1$
  3. $\left ( A_{7} \cdot B_{7} \cdot \overline{S_{7}}+\overline{A_{7}} \cdot \overline{B_{7}} \cdot S_{7} \right )$ is $1$
  4. $\left ( A_{0} \cdot B_{0} \cdot \overline{S_{0}}+\overline{A_{0}} \cdot \overline{B_{0}} \cdot S_{0} \right )$ is $1$
edited by

6 Answers

4 votes
4 votes

Answer: (C) 

Explanation: Overflow indicates that the result was too large or too small to fit in the original data type.
Overflow flag indicates an overflow condition for a signed operation. Signed numbers are represented in two’s complement representation. 
The overflow occurs only when two positive number are added and the result is negative or two negative number are added and the result is positive. Otherwise, the sum has not overflowed.

Therefore, a XOR operation can quickly determine if an overflow condition exists. i.e., 
(A7 . B7 )⊕(S7) = (A7 . B7 . S7‘ + A7‘ . B7‘ . S7 = 1

http://www.geeksforgeeks.org/gate-gate-cs-2017-set-1-question-35/

Answer:

Related questions

45 votes
45 votes
4 answers
3