GATE / CS ARCHIVE

GATE CSE 2017 SET 1 / QUESTION 9

GATE CSE 2017 Set 1 Q9

Digital Logic · Number Systems & Computer Arithmetic · Full GATE CSE 2017 Set 1 paper

GATE 2017 Set 1, Q9 1 mark · MCQ
Report issue

Number Systems & Computer Arithmetic

Question 9, GATE 2017: Two 8-bit two’s-complement numbers A7...A0 and B7...B0 are added, producing S7...S0 and carry bits C7...C0. A0 and B0 are least significant. Which detects overflow? A C7=1; B all carries 1; C A7 B7 ¬S7 + ¬A7 ¬B7 S7=1; D A0 B0 ¬S0 + ¬A0 ¬B0 S0=1. Products mean AND and + means OR.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

1. In two’s complement the high bit is the sign. Opposite-sign addition cannot exceed both representable bounds, so overflow requires equal operand signs.

2. If both signs are 0, overflow means the result sign is 1: ¬A7∧¬B7∧S7. If both signs are 1, overflow means the result sign is 0: A7∧B7∧¬S7.

3. OR the two mutually exclusive cases to obtain C. For example, 127+1 produces negative 8-bit result without needing an unsigned carry-out; sign overflow and unsigned carry are different tests.

Original paper, page 5 · Answer key