Skip to main content
Numverto numverto
binary negative numbers complement

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.

Numverto Editorial Team Numverto Editorial Team 6 min read Editorial standards

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 = positive
  • 1 = negative

The remaining bits hold the magnitude (absolute value).

Example (4-bit):

DecimalSign-Magnitude
+70111
+30011
+00000
-01000
-31011
-71111

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

DecimalBinary (1’s Comp)
+70111
+60110
+30011
+10001
+00000
-01111
-11110
-31100
-61001
-71000

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

DecimalSign-Magnitude1’s Complement2’s Complement
+7011101110111
+6011001100110
+5010101010101
+4010001000100
+3001100110011
+2001000100010
+1000100010001
0000000000000
-1100111101111
-2101011011110
-3101111001101
-4110010111100
-5110110101011
-6111010011010
-7111110001001
-81000

Range Comparison

MethodN-bit Range4-bit Range8-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:

  1. One zero — no ambiguity
  2. Addition works naturally — no special correction needed
  3. Subtraction = addition — A - B = A + (-B) = A + (complement of B)
  4. Hardware is simpler — same adder circuit handles both signed and unsigned
  5. 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.

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.

Advertisement
Share: Twitter LinkedIn Facebook

Free tools

Learn faster with Numverto

Free number system converters, binary tools, EMI calculators, and more, with step-by-step working.

Written by

Numverto Editorial Team

Numverto Editorial Team

Founder of Numverto. MCA graduate, full-stack developer, and lifelong learner who built this platform so every student gets the explanation, not just the answer.

Related tools

Advertisement

More from Numverto Blog

Discussion

Comments

Popular Tools

View all 25 free tools → · Read tutorials · Number system guide