The **One’s Complement Method** is a technique used to represent signed integers (both positive and negative) in binary form. It is an older method that was once widely used in digital systems and computer arithmetic, although it has largely been replaced by the more efficient two’s complement method in modern systems. Understanding one’s complement is essential for grasping the evolution of binary number systems and their applications in computing.

#### Basic Concepts of Binary Number Representation

Before diving into the one’s complement method, it’s important to understand the basics of binary number representation:

**Binary System (Base 2):**The binary number system uses only two digits, 0 and 1, to represent numbers. Each digit in a binary number is called a bit.**Unsigned Binary Representation:**Unsigned binary numbers represent only non-negative integers. For example, the binary number $1010_2$ represents $1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 0 \times 2^0 = 10_{10}$ in decimal.

When dealing with both positive and negative numbers, special methods like one’s complement are used.

#### One’s Complement Method

In the one’s complement method:

**Positive numbers**are represented in the same way as in unsigned binary.**Negative numbers**are represented by inverting (flipping) all the bits of the corresponding positive number.

For example, to represent $-5$ in one’s complement form:

- Start with the binary representation of $+5$, which is $0101_2$ (in a 4-bit system).
- Invert all bits: $0101_2$ becomes $1010_2$.
- $1010_2$ is the one’s complement representation of $-5$.

##### Example: 4-Bit One’s Complement Representation

Let’s consider a 4-bit binary system using the one’s complement method:

**Positive numbers:**Represented as in unsigned binary.**Negative numbers:**Obtained by inverting all bits of the positive counterpart.

**Examples:**

$+3_{10}$ in 4-bit binary is $0011_2$.

- To find $-3_{10}$, invert all bits: $0011_2$ becomes $1100_2$.

$+7_{10}$ in 4-bit binary is $0111_2$.

- To find $-7_{10}$, invert all bits: $0111_2$ becomes $1000_2$.

Here’s a table showing all possible 4-bit one’s complement representations:

Decimal Value | Positive Binary | One’s Complement (Negative) |
---|---|---|

+7 | 0111 | – |

+6 | 0110 | 1001 |

+5 | 0101 | 1010 |

+4 | 0100 | 1011 |

+3 | 0011 | 1100 |

+2 | 0010 | 1101 |

+1 | 0001 | 1110 |

+0 | 0000 | 1111 |

-0 | 1111 | – |

-1 | – | 1110 |

-2 | – | 1101 |

-3 | – | 1100 |

-4 | – | 1011 |

-5 | – | 1010 |

-6 | – | 1001 |

-7 | – | 1000 |

##### Important Observations:

**Positive and negative zero:**In a 4-bit system, both $0000_2$ and $1111_2$ represent zero, but with different signs. This results in two representations of zero, which is inefficient and can cause confusion.**Range of numbers:**In an n-bit one’s complement system, the range of representable numbers is $-(2^{n-1} – 1)$ to $+(2^{n-1} – 1)$.

For example, in the 4-bit system:

- Maximum positive value = $+(2^3 – 1) = +7$.
- Minimum negative value = $-(2^3 – 1) = -7$.

#### Arithmetic Operations in One’s Complement

One’s complement arithmetic involves additional steps due to the presence of two zeros and the bit-inversion technique. Here’s how addition and subtraction work in one’s complement:

##### Addition Example

Let’s add $+5$ and $-3$ in a 4-bit system using one’s complement.

**Find the binary representations:**- $+5_{10} = 0101_2$
- $-3_{10} = 1100_2$ (one’s complement of $+3$)

**Add the numbers:**- $0101_2 + 1100_2 = 10001_2$

**Handle the carry:**- In one’s complement, if there is a carry out (leftmost bit), add it back to the rightmost bit.
- Here, the carry is 1. So, add 1 to the result: $0001_2$.
- The final result is $0001_2 = +2_{10}$.

##### Subtraction Example

To subtract $3$ from $5$, we can add $+5$ to $-3$, as shown above.

**Find the binary representations:**- $+5_{10} = 0101_2$
- $-3_{10} = 1100_2$ (one’s complement of $+3$)

**Add the numbers:**- $0101_2 + 1100_2 = 10001_2$

**Handle the carry:**- Add the carry to the result: $0001_2 = +2_{10}$.

The result is $+2$, as expected.

#### Advantages and Disadvantages of One’s Complement

**Advantages:**

**Simplicity:**One’s complement is easier to understand and implement compared to two’s complement for small systems.**Bitwise operations:**The bitwise operations used to invert bits are straightforward and efficient.

**Disadvantages:**

**Two representations of zero:**The existence of both +0 and -0 can complicate calculations and logic in digital systems.**End-around carry:**The need to handle end-around carry when adding negative numbers adds complexity to arithmetic operations.**Not widely used:**Due to its limitations, one’s complement has been largely replaced by two’s complement in modern computing systems.

#### Comparison with Two’s Complement

**Two’s Complement:**In two’s complement, negative numbers are represented by inverting the bits of the positive number and adding 1. It has only one representation of zero and simplifies arithmetic operations by avoiding the need for end-around carry. This makes two’s complement more efficient and widely used in modern systems.

#### Conclusion

The One’s Complement Method is a historically important way of representing signed integers in binary form. Although it has largely been replaced by the more efficient two’s complement method, understanding one’s complement is essential for grasping the evolution of binary number systems and their applications in computing. While it offers simplicity in some respects, its drawbacks, such as the dual representation of zero and the complexity of arithmetic operations, have led to its decline in favor of more robust methods.

### References

**Digital Design: Principles and Practices**by John F. Wakerly: This textbook provides an in-depth discussion of number systems, including the one’s complement method, and their applications in digital circuits.**Computer Organization and Architecture: Designing for Performance**by William Stallings: This book offers a comprehensive look at computer architecture, including different methods of representing signed numbers like one’s complement and two’s complement.**Computer Architecture: A Quantitative Approach**by John L. Hennessy and David A. Patterson: This book discusses various number representation methods, including one’s complement, and their impact on computer performance and design.**Binary Arithmetic**– GeeksforGeeks: An online resource that explains the concepts of binary arithmetic, including one’s complement, with examples and detailed explanations. Available at: GeeksforGeeks.

These references provide detailed explanations of the one’s complement method and its place in the broader context of digital design, computer architecture, and binary arithmetic.