Signed Number Representation: Sign-Magnitude, 1’s Complement, and 2’s Complement

Signed Number Representation: Sign-Magnitude, 1’s Complement, and 2’s Complement

Verified Sources
Nov 4, 2026

Signed number representations encode negative integers in binary by dedicating meaning to the most significant bit(s) and by defining arithmetic rules for addition/subtraction. The three classical schemes are:

  • Sign-magnitude: sign bit + magnitude bits.
  • One’s complement: yields two zeros.
  • Two’s complement: yields a single zero and enables straightforward addition.

A conceptual view is: each representation defines (1) how to encode values into nn bits and (2) what binary addition does with encoded operands. In hardware, the key practical goal is to make addition logic uniform and simple across signs, while minimizing special cases like multiple zeros or extra correction steps.

Important note: Due to a tooling limitation, web citations could not be retrieved for this run. As a result, the required inline citation system ($$ style) and footnotes could not be produced. The content below is still technically accurate, but you should verify against a textbook or reference during production.

Core definitions to keep consistent

  • MSB is typically the sign-related bit.
  • Bitwise complement defines one’s complement negativity.
  • Carry/overflow affects meaning near limits.

Signed Binary: Sign-Magnitude vs 1's Complement vs 2's Complement

How each scheme represents negatives (encoding rules)

1) Sign-magnitude

In an nn-bit word:

  • The sign bit determines polarity: typically 00 for nonnegative, 11 for negative.
  • The remaining n−1n-1 bits store the absolute value (“magnitude”).

If x≥0x \ge 0, encode magnitude directly. If x<0x < 0, encode the magnitude and set the sign bit to 11.

Consequence: arithmetic must explicitly handle differing sign bits; raw unsigned addition does not directly equal signed addition.

2) One’s complement

Define nonnegative xx normally in nn bits. To represent a negative value:

  • Compute the bitwise complement of the positive representation.

Equivalently, if PP is the nn-bit pattern for +x+x, then the nn-bit pattern for −x-x is P‾\overline{P}.

Consequence: there are two encodings for zero:

  • +0+0 is all zeros.
  • −0-0 is all ones.

Addition also has a special rule: if there is a carry out of the most significant bit, it must be added back (“end-around carry”)—this is a correction step not present in two’s complement.

3) Two’s complement

Again, encode nonnegative xx normally. For negative values:

  • Take the one’s complement and add 11.

Equivalently: if PP is the nn-bit pattern for +x+x, then −x-x is the bitwise complement of PP plus 11 (modulo 2n2^n).

Consequence: there is a single zero representation (all zeros), and addition can use standard binary adders with wraparound; the hardware behavior corresponds to signed arithmetic interpretation within the representable range.

[s][magnitude bits]
s=0 → +x
s=1 → -x
magnitude = |x|

Visualizing the bit patterns around zero

Even without choosing an explicit bit-width, each scheme’s “shape” differs near zero and affects arithmetic correctness and simplicity.

Advantages/Disadvantages by Scheme (qualitative)

A quick comparison across practical engineering concerns (higher is better for the 'advantage' qualities).

Advantages and disadvantages (deep, engineering-focused)

Sign-magnitude

Advantages

  1. Direct interpretability: you can interpret magnitude and sign separately.
  2. Negation operation can be as simple as flipping only the sign bit (with magnitude unchanged).

Disadvantages

  1. Two encodings of zero: both “+0” and “−0” exist, which complicates equality checks and some arithmetic edge cases.
  2. Arithmetic complexity: standard addition of bit patterns does not directly correspond to signed addition across sign changes without additional handling.
  3. Overflow behavior is less “natural” for pure adder hardware; designers typically prefer representations where the same adder works for signed addition.

One’s complement

Advantages

  1. Negation via bitwise NOT: −x-x is the bitwise complement of +x+x.
  2. Addition hardware can be close to standard addition, but with one correction conceptually tied to end-around carry.

Disadvantages

  1. Two zeros persist: +0+0 and −0-0 both exist.
  2. End-around carry correction: addition requires an additional step when there is carry out, complicating circuits compared with two’s complement.
  3. Some comparison and normalization logic can become more intricate because of the second zero representation.

Two’s complement

Advantages

  1. Single zero eliminates ambiguity and simplifies equality/edge-case logic.
  2. Uniform addition: two’s complement arithmetic corresponds to standard binary addition modulo 2n2^n, and overflow can be detected/handled using sign-bit rules.
  3. Hardware efficiency: widely supported by CPU/ALU design.

Disadvantages

  1. Asymmetric range: for nn bits, the representable range is typically −2n−1-2^{n-1} to 2n−1−12^{n-1}-1, so the negative side has one extra magnitude compared with positive.
  2. Overflow wraparound: two’s complement addition “wraps” in the modular sense, so overflow detection is necessary for correctness in bounded arithmetic.
  3. Negation not just sign flip: while there are fast methods, negating in general involves the complement plus one rule, not just flipping a single bit (unlike sign-magnitude’s simple sign-bit flip).

Negation and representation workflow for each scheme (on an n-bit word)

  1. 1
    Step 1

    Fix nn bits. Decide what integer range you must support.

  2. 2
    Step 2

    Write xx in binary using nn bits (standard unsigned encoding).

  3. 3
    Step 3

    For −x-x, keep magnitude bits as for xx and flip the sign bit to 1.

  4. 4
    Step 4

    For −x-x, compute the bitwise NOT of the nn-bit pattern for +x+x.

  5. 5
    Step 5

    For −x-x, compute bitwise NOT of +x+x and then add 1 (modulo 2n2^n).

  6. 6
    Step 6

    Sign-magnitude and one’s complement admit multiple zero encodings; two’s complement admits a single zero encoding.

  7. 7
    Step 7

    Sign-magnitude and one’s complement require sign-aware or correction logic; two’s complement works with standard addition plus overflow detection.

Common edge cases and misconceptions

Why two’s complement became dominant

Clarity-first thinking

Sign-magnitude era

Separate sign and magnitude was intuitive, but arithmetic required extra logic."

Bitwise negation and partial hardware reuse

One’s complement adoption

Negation became simple (~P), but the end-around carry and two zeros remained."

Uniform addition with fewer special cases

Two’s complement standardization

Single zero and standard adder behavior made it practical for ALUs."

Signed representations quick checks

1 / 5
Question · Term

What does sign-magnitude do for negative numbers?

Click to reveal
Answer · Definition

It flips/sets the sign bit to 1 and keeps magnitude bits as |x|.

Knowledge Check

Question 1 of 4
Q1Single choice

Which representation can have two different bit patterns that both represent the numeric value 0?