Two's Complement Arithmetic

CSC-213 · Semester III · Computer Architecture

Two's Complement Arithmetic

Add signed numbers and watch for overflow.

Width

A = 00110010

B = 00011110

Σ = 01010000

Why it works

Negative numbers are stored as the two's complement: invert every bit, add 1. The most significant bit becomes the sign.

Addition uses the same binary adder as unsigned numbers — no special hardware for subtraction needed.

Overflow happens only when both operands share a sign and the result flips it. The carry into the sign bit differs from the carry out.