Two’s Complement definition
Two’s complement is a fixed-width binary representation that can encode positive, zero, and negative integers.
Two’s Complement in a picture
How it works
In an n-bit word, the highest bit has weight −2ⁿ⁻¹, while the other bits use ordinary positive weights. An n-bit word represents values from −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1. To negate a representable value within the width, flip every bit and add one, discarding a carry beyond the width. The most negative value has no positive counterpart within the same width.
Worked examples
Decode 1111 in four-bit two’s complement.
−8 + 4 + 2 + 1 = −1.
Encode −3 using four bits.
Start from 0011, invert to 1100, and add 1 to get 1101.
What is the signed range for four bits?
−8 to 7.
Common mistake
State the bit width and interpretation. The same pattern can give different values with unsigned and signed weights.
Quick check
What is the weight of the top bit in a four-bit word?
Show answer
−8.
Can +8 fit in four-bit two’s complement?
Show answer
No. The largest value is 7.
Sources
Flashcard
Two’s Complement
Reveal the definition
Two’s complement is a fixed-width binary representation that can encode positive, zero, and negative integers.
Effortless Math. “Two’s Complement.” Math Dictionary.



