CS Atlas GATE 2027
Digital Logic course
0 / 57 complete

Digital Logic/Phase 1 · Signed Numbers & Binary Arithmetic

Lesson 1.1.1 · Item 7 of 57

Sign-magnitude, 1's complement and 2's complement

Read at your own pace. Try the questions before opening the answers.

On this page

0 · Recall Warm-up

Answer from memory first. Answers are in the Answer Vault at the bottom.

  • In an n-bit adder, what does carry out = 1 mean for unsigned numbers? from Lesson 0.1.3
  • What is 1217₈ in hex? from Lesson 0.1.2
  • Largest unsigned value in 8 bits? from Lesson 0.1.1

1 · The Hook

🎣

A bank balance can be −₹500. A thermometer can read −7°. But a register is just a row of bits, with no room for a minus sign printed in front. Computers have tried three ways to store negative numbers; one of them, 2's complement, won because the same adder then works for positive and negative numbers. GATE asks ranges, conversions and "what value is this bit pattern" in nearly every paper.

2 · Predict First

🤔

Idea: use the leftmost bit as a sign (0 = +, 1 = −) and the rest as the size. In 4 bits, +5 is 0101. What would −5 be? How many different ways can you write zero?

Make a guess in your head. The answer opens Section 3.

3 · Core Concept

💡

Predict First — the answer

−5 = 1101. Zero can be written two ways: 0000 (+0) and 1000 (−0), which wastes a pattern and complicates circuits.

🗣️

In plain words

All three systems agree for positive numbers: the leftmost bit is 0 and the rest is ordinary binary. They differ in how they write negatives. Sign-magnitude just flips the first bit. 1's complement flips every bit. 2's complement flips every bit and then adds 1, which turns out to be the same as giving the leftmost place a negative worth.

1. Sign-magnitude (SM)

MSB = sign (0 positive, 1 negative); the other n − 1 bits are the size. −23 in 8 bits: +23 = 0001 0111 → 1001 0111. Two zeros (0000 0000 and 1000 0000). Range: −(2ⁿ⁻¹ − 1) … +(2ⁿ⁻¹ − 1).

2. 1's complement

Negative = invert every bit of the positive number. −23: invert 0001 0111 → 1110 1000. Also two zeros (0000 0000 and 1111 1111). Same range as SM.

3. 2's complement (the one computers use)

Negative = invert every bit, then add 1. −23: 1110 1000 + 1 = 1110 1001. Shortcut: copy bits from the right up to and including the first 1, then invert everything to its left (0001 0111 → keep "1", invert the rest → 1110 1001).

  • One zero only. Range: −2ⁿ⁻¹ … +2ⁿ⁻¹ − 1 (one extra negative number). 8 bits: −128 … +127.
  • Reading a pattern: the MSB is worth −2ⁿ⁻¹, every other bit its usual positive worth. 1110 1001 = −128 + 64 + 32 + 8 + 1 = −23.
  • The most negative number has no positive partner: in 8 bits, negating −128 gives −128 again.

4. One pattern, three meanings

The 8-bit pattern 1011 0110:

SystemValue
Unsigned182
Sign-magnitude−(011 0110) = −54
1's complement−(0100 1001) = −73
2's complement−128 + 54 = −74

5. Ranges side by side (n bits)

SystemSmallestLargestZeros
Unsigned02ⁿ − 11
Sign-magnitude−(2ⁿ⁻¹ − 1)2ⁿ⁻¹ − 12
1's complement−(2ⁿ⁻¹ − 1)2ⁿ⁻¹ − 12
2's complement−2ⁿ⁻¹2ⁿ⁻¹ − 11

4 · Visual

4-bit 2's complement on a clock face: the MSB is worth -8

        0000 (0)
   1111 (-1)    0001 (1)
 1110 (-2)          0010 (2)
1101 (-3)             0011 (3)
1100 (-4)             0100 (4)
 1011 (-5)          0101 (5)
   1010 (-6)    0110 (6)
        1001 (-7)  0111 (7)
           1000 (-8)
Counting up past 0111 (+7) jumps to 1000 (-8): that jump is overflow.

5 · Worked Examples

Example 1 Easy

Write −100 in 8-bit 2's complement.

Solution

+100 = 0110 0100 → invert 1001 1011 → add 1 → 1001 1100.

Example 2 Medium

What does the 8-bit pattern 1011 0110 mean in sign-magnitude, 1's complement and 2's complement?

Solution

−54, −73, −74 (table above).

Example 3 GATE

What is the range of 6-bit 2's-complement numbers?

Solution

−32 … +31.

6 · GATE Traps

⚠️

  • 2's complement = invert and add 1; 1's complement is invert only.
  • In 2's complement the MSB has negative weight −2ⁿ⁻¹ (not "minus the rest").
  • 2's complement has one more negative number than positive; SM and 1's complement are symmetric with two zeros.
  • Positive numbers look the same in all three systems.

7 · Memory Hook

🧠

"SM flips the sign bit, 1's flips all bits, 2's flips all and adds one. In 2's complement the top bit is worth minus."

8 · Connect the Dots

Why did 2's complement win? Because adding two 2's-complement patterns with an ordinary binary adder gives the right signed answer. The next lesson does that arithmetic and learns to detect when the answer doesn't fit: overflow.

9 · Self-Test

GATE format. Try every question before opening the vault.

Q1MCQ1 mark2's complement

−100 in 8-bit 2's complement is:

  • (A) 1001 1100
  • (B) 1110 0100
  • (C) 0110 0100
  • (D) 1001 1011

Q2NAT1 markReading 2's complement

What decimal value does the 8-bit 2's-complement pattern 1011 0110 represent?

Numerical answer: ________

Q3NAT1 markReading 1's complement

What decimal value does the 8-bit 1's-complement pattern 1011 0110 represent?

Numerical answer: ________

Q4NAT1 markRange

What is the smallest (most negative) value of a 6-bit 2's-complement number?

Numerical answer: ________

Q5MSQ2 marksZeros

Which representations have two different bit patterns for zero?

  • (A) 2's complement
  • (B) 1's complement
  • (C) Unsigned binary
  • (D) Sign-magnitude

10 · Rule Card

  • Positive numbers: same in SM, 1's and 2's complement (MSB 0).
  • SM: flip the sign bit. 1's: invert all bits. 2's: invert all and add 1 (or copy up to the first 1 from the right, invert the rest).
  • 2's complement value: MSB worth −2ⁿ⁻¹; range −2ⁿ⁻¹ … 2ⁿ⁻¹ − 1; one zero.
  • SM and 1's complement: range ±(2ⁿ⁻¹ − 1), two zeros.

11 · Concept Ledger

Unlocked in this lesson. From here on, these terms may be used.

signed numberssign-magnitude1's complement2's complementnegating in 2's complementnegative weight of the MSBranges of signed systemstwo zerosasymmetric 2's-complement range

12 · Answer Vault

Answer Vault

Try the questions first. Open when you are ready to check.

Recall Warm-up

  • The true sum didn't fit in n bits.
  • 28F.

Self-Test

Q1 Answer: (A)1 mark

Invert 0110 0100 and add 1.

  • (B) is wrong: Sign-magnitude.
  • (C) is wrong: +100.
  • (D) is wrong: 1's complement.

Re-read: Lesson 1.1.1 — Sign-magnitude, 1's complement and 2's complement

Q2 Answer: -741 mark

−128 + 32 + 16 + 4 + 2.

Re-read: Lesson 1.1.1 — Sign-magnitude, 1's complement and 2's complement

Q3 Answer: -731 mark

Invert: 0100 1001 = 73.

Re-read: Lesson 1.1.1 — Sign-magnitude, 1's complement and 2's complement

Q4 Answer: -321 mark

−2⁵.

Re-read: Lesson 1.1.1 — Sign-magnitude, 1's complement and 2's complement

Q5 Answer: (B) (D)2 marks

+0 and −0 both exist.

  • (A) is wrong: Only 0000…0.
  • (C) is wrong: Only 0000…0.

Re-read: Lesson 1.1.1 — Sign-magnitude, 1's complement and 2's complement

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.