Imagine you have 8 boxes. Each box can hold a 0 or a 1. This is called a bit. In two's complement, we use these bits to show both positive and negative numbers. The first box (on the left) is special. It tells us if the number is positive (0) or negative (1). If it is 0, the number is positive. If it is 1, the number is negative. This way, we can show numbers below zero too!
8-bit Two's Complement: Range
Smallest
Largest
Binary
10000000
01111111
Decimal
-128
+127
How it works
Write 8 bits: the leftmost bit is the sign bit.
If the sign bit is 0, the number is positive (0 to 127).
If the sign bit is 1, the number is negative (−1 to −128).
The largest positive number: sign bit 0, all other bits 1 (01111111).
The smallest negative number: sign bit 1, all other bits 0 (10000000).
The story behind it
Two's complement was made to make adding and subtracting negative numbers easy for computers. Before this, computers had to use tricky methods to handle negative numbers. Two's complement made the circuits simpler and faster. It is now used in almost every computer and phone.
Where you see it in real life
Mobile phones: Storing numbers like temperature or speed, which can be negative.
Calculators: Doing subtraction, like 5 − 10 = −5.
Game scores: Showing scores that can go below zero.
Banking apps: Recording a negative balance.
Why it matters
It helps computers do math with negative numbers easily.
It saves memory and makes calculations faster.
It is the standard way most computers store signed numbers.
Understanding it is key for programming, electronics, and computer science exams.