Similar questions 6 more →
Number Systems & Computer Arithmetic

Answer & solution
Official answer: B, D
Step through it (4 options)
Givens and goal
Use 4-bit two’s-complement integers N1=1011, N2=1101, N3=1010, N4=1001. Which operations overflow? A N1+N2; B N2+N3; C N3−N4; D N1+N4.
Approach
Convert operands to signed values and compare exact results with the representable interval.
Step-by-step solution
1. Four-bit two’s complement represents −8 through 7. A bit pattern with leading 1 has signed value equal to its unsigned value minus 16. Thus N1=11−16=−5, N2=−3, N3=−6, N4=−7.
2. A gives −5+(−3)=−8, exactly the lower endpoint and therefore representable as 1000. Merely having a carry out does not establish signed overflow.
3. B gives −3+(−6)=−9, below −8. The retained four bits would be 0111, a positive 7, so signed overflow occurs. C gives −6−(−7)=1, represented by 0001, so it is safe.
4. D gives −5+(−7)=−12, also below the range. Its wrapped pattern is 0100, positive 4. Therefore B and D overflow.
5. For addition of same-sign operands, a changed result sign is a convenient equivalent test, but checking the exact mathematical result also handles the subtraction correctly.