Negative Numbers in Binary — Sign Bit, 1's and 2's Complement Explained
Learn how computers represent negative numbers using sign-magnitude, 1's complement, and 2's complement methods with reference tables and worked examples.
The Problem: How Do You Show “Minus” in Binary?
Binary digits are 0 and 1 — there’s no minus sign. Yet computers must handle negative numbers for subtraction, temperature readings, financial losses, and countless other operations. So how does a processor know that 11111111 means -1 and not 255?
🔧 Calculate complements: 1’s & 2’s Complement Calculator — enter any binary number and see both complements with step-by-step working.
Three methods have been used historically. Let’s explore each one.
Method 1: Sign-Magnitude
The simplest idea — use the leftmost bit as a sign indicator:
0= positive1= negative
The remaining bits hold the magnitude (absolute value).
Example (4-bit):
| Decimal | Sign-Magnitude |
|---|---|
| +7 | 0111 |
| +3 | 0011 |
| +0 | 0000 |
| -0 | 1000 |
| -3 | 1011 |
| -7 | 1111 |
Problem: Two representations of zero (0000 and 1000), and arithmetic hardware becomes complex.
Method 2: 1’s Complement
To negate a number, flip every bit (0→1, 1→0).
Example: Find -5 in 8-bit 1’s complement
+5 in binary: 00000101
Flip all bits: 11111010 ← This is -5
4-bit 1’s Complement Table
| Decimal | Binary (1’s Comp) |
|---|---|
| +7 | 0111 |
| +6 | 0110 |
| +3 | 0011 |
| +1 | 0001 |
| +0 | 0000 |
| -0 | 1111 |
| -1 | 1110 |
| -3 | 1100 |
| -6 | 1001 |
| -7 | 1000 |
Problem: Still has two zeros (0000 = +0, 1111 = -0). Addition requires “end-around carry” correction.
Method 3: 2’s Complement (Modern Standard)
To negate a number: flip all bits, then add 1.
Example: Find -5 in 8-bit 2’s complement
+5 in binary: 00000101
Flip all bits: 11111010
Add 1: + 1
─────────
Result: 11111011 ← This is -5
Verification: +5 + (-5) should = 0
00000101 (+5)
+ 11111011 (-5)
──────────
100000000 (carry discarded → 00000000 = 0) ✓
Complete 4-bit Comparison Table
| Decimal | Sign-Magnitude | 1’s Complement | 2’s Complement |
|---|---|---|---|
| +7 | 0111 | 0111 | 0111 |
| +6 | 0110 | 0110 | 0110 |
| +5 | 0101 | 0101 | 0101 |
| +4 | 0100 | 0100 | 0100 |
| +3 | 0011 | 0011 | 0011 |
| +2 | 0010 | 0010 | 0010 |
| +1 | 0001 | 0001 | 0001 |
| 0 | 0000 | 0000 | 0000 |
| -1 | 1001 | 1110 | 1111 |
| -2 | 1010 | 1101 | 1110 |
| -3 | 1011 | 1100 | 1101 |
| -4 | 1100 | 1011 | 1100 |
| -5 | 1101 | 1010 | 1011 |
| -6 | 1110 | 1001 | 1010 |
| -7 | 1111 | 1000 | 1001 |
| -8 | — | — | 1000 |
Range Comparison
| Method | N-bit Range | 4-bit Range | 8-bit Range |
|---|---|---|---|
| Sign-Magnitude | -(2^(n-1)-1) to +(2^(n-1)-1) | -7 to +7 | -127 to +127 |
| 1’s Complement | -(2^(n-1)-1) to +(2^(n-1)-1) | -7 to +7 | -127 to +127 |
| 2’s Complement | -2^(n-1) to +(2^(n-1)-1) | -8 to +7 | -128 to +127 |
Key advantage of 2’s complement: One extra negative value, single zero, and simple addition hardware.
Why 2’s Complement Won
Modern CPUs (x86, ARM, RISC-V) all use 2’s complement because:
- One zero — no ambiguity
- Addition works naturally — no special correction needed
- Subtraction = addition — A - B = A + (-B) = A + (complement of B)
- Hardware is simpler — same adder circuit handles both signed and unsigned
- Overflow detection — simple carry/sign bit check
Worked Example: 8-bit Subtraction Using 2’s Complement
Calculate: 25 - 40
Step 1: +25 = 00011001
Step 2: +40 = 00101000
Step 3: -40 = flip(00101000) + 1
= 11010111 + 1
= 11011000
Step 4: 25 + (-40) = 00011001 + 11011000
= 11110001
Step 5: MSB is 1 → result is negative
To find magnitude: flip(11110001) + 1
= 00001110 + 1
= 00001111 = 15
Answer: -15 ✓ (25 - 40 = -15)
Overflow Detection
Overflow occurs when the result doesn’t fit in the available bits:
- Adding two positive numbers gives negative → overflow
- Adding two negative numbers gives positive → overflow
- Adding opposite signs → never overflows
Example: 8-bit, +100 + +50
01100100 (+100)
+ 00110010 (+50)
──────────
10010110 (= -106 in signed, WRONG!)
Result MSB is 1 (appears negative) — overflow detected.
Related Tools
Related Articles
FAQ
Q: Why don’t computers use sign-magnitude like humans write -5? A: Sign-magnitude requires special subtraction hardware and has two zeros. 2’s complement lets the same adder circuit handle both positive and negative numbers — cheaper and faster.
Q: What happens when you overflow in 2’s complement? A: The result wraps around. In 8-bit: 127 + 1 = -128. This is undefined behavior in C/C++ for signed integers, but defined (wrapping) for unsigned.
Q: How do I know if a binary number is negative in 2’s complement? A: Check the MSB (Most Significant Bit). If it’s 1, the number is negative. If 0, it’s positive or zero.
Q: Is 2’s complement used in floating point too? A: The exponent in IEEE 754 uses a “biased” representation (not 2’s complement), but the significand is stored as a positive magnitude with a separate sign bit.
Q: What is the 2’s complement of 0? A: Flip 00000000 → 11111111, add 1 → 100000000. The carry is discarded, giving 00000000. So -0 = +0 — exactly one zero representation.
Share this article
Learn Faster with Numverto
Explore free number system converters, binary tools, EMI calculators, GST calculators, and educational guides.
About Numverto
Numverto Editorial Team
Numverto publishes educational content about number systems, computer science concepts, binary arithmetic, financial calculations, EMI formulas, GST calculations, and practical learning resources for students and professionals.
Article Metadata
Tags: binary, negative numbers, complement, computer architecture, btech
Last Updated: June 2026
Related Calculators
Related Articles
25 June 2026
Hexadecimal (Hex) क्या है — आसान भाषा में समझें
Hexadecimal number system की पूरी जानकारी हिंदी में। Hex क्या है, 0-9 और A-F क्यों use होते हैं, decimal और binary से कैसे convert करें।
Read article →24 June 2026
Binary Number System क्या है — आसान भाषा में समझें
Binary number system की पूरी जानकारी हिंदी में। Binary क्या है, कैसे काम करता है, और decimal में कैसे convert करें — examples के साथ।
Read article →22 June 2026
Bitwise Operators in Programming — AND, OR, XOR, NOT Explained with Examples
Learn how bitwise AND, OR, XOR, NOT, left shift, and right shift operators work with binary examples in C, Java, and Python.
Read article →