Number Systems & Computer Arithmetic
![Question 39, GATE 2006: An ordinary binary adder adds two n-bit two’s-complement numbers aₙ₋₁…a₀ and bₙ₋₁…b₀. Its result bits are cₙ₋₁…c₀ and carry-out is c_out. Which expression detects signed overflow? Let a=aₙ₋₁,b=bₙ₋₁,c=cₙ₋₁. Both reproductions print a continuous bar over ab in the second term of B; its scope must not be silently normalized.
Options:
(A) c_out·¬(a⊕b)
(B) ab¬c+overline(ab)c [continuous source bar; intended separate-literal reading: ab¬c+¬a¬bc]
(C) c_out⊕c
(D) a⊕b⊕c](../../assets/questions/CS-2006-Q39-1.webp)
Answer & solution
Answer: B only under separate-literal complement reading; printed grouped bar is ambiguous (no official key was published)
1. Signed overflow occurs when both operand sign bits agree and the result sign differs: V=ab¬c+¬a¬bc. For example, two positive operands overflowing the positive range give a=b=0,c=1.
2. Read literally as a grouped complement, the printed expression is ab¬c+¬(ab)c, not the standard overflow expression.
3. A counterexample is four-bit −8+1=−7: a=1,b=0,c=1, with no signed overflow, but ¬(ab)c=1. Therefore printed B works only if its spanning bar is intended to mean separately complemented literals. That intended reading must be stated explicitly; the original official wording and key are unavailable.
4. The other expressions are not general overflow detectors. With four-bit −1+1=0, c_out=1,c=0 and C incorrectly signals overflow. D fails on −8+(−1), whose sign bits are a=b=1,c=0: D=0 although overflow occurs. A misses positive overflow 7+1 because c_out=0.
5. Teaching check: Compute overflow from operand and result signs, then check the scope of every complement. Carry-out is an unsigned carry indicator, not signed overflow. The retained B answer is conditional on the separate-literal reading, not a verified literal-source or official-key answer.