## Introduction

1’s Complement Number is a method of representing signed integers in binary form. It is a way of encoding negative numbers in binary form by inverting all the bits of the corresponding positive number.

## Characteristics

- In one’s complement, the negative of a number is obtained by inverting all its bits.
- One’s complement is a method of representing signed integers in binary form.
- The range of values that can be represented using one’s complement is from -2^(n-1)+1 to 2^(n-1)-1, where n is the number of bits in the binary representation.

## Construction

To construct the one’s complement representation of a negative number, you first take the binary representation of the positive equivalent of the number. Then, you flip all the bits of the result to obtain the one’s complement representation. For example, to find the one’s complement of -5, you first find the binary representation of 5, which is 0101. Then, you flip all the bits to obtain 1010, which is the one’s complement of -5.

## Working

One’s complement is used in computer systems and digital circuits to represent both positive and negative values. To add two numbers in one’s complement form, you simply add them together as if they were unsigned binary numbers. If the result is larger than the largest number that can be represented in the given number of bits, then the result is truncated to fit within the given range. To subtract one number from another in one’s complement form, you simply add the negative of the second number to the first number.

## Procedure

To convert a decimal number to its one’s complement representation, you must first determine the number of bits required to represent the number. Then, you convert the magnitude of the number to binary form and apply the one’s complement operation to the result. To convert a one’s complement representation back to decimal form, you must first determine whether the number is positive or negative by examining the sign bit. If the sign bit is 1, then the number is negative, and you must apply the one’s complement operation to the remaining bits and add a negative sign to the result. If the sign bit is 0, then the number is positive, and you can simply convert the remaining bits to decimal form.

## Rules

- In one’s complement, the negative of a number is obtained by inverting all its bits.
- To find the one’s complement of a negative number, you first find the binary representation of its positive equivalent, and then flip all its bits.
- To add two numbers in one’s complement form, you simply add them together as if they were unsigned binary numbers.
- To subtract one number from another in one’s complement form, you simply add the negative of the second number to the first number.

## Formula

To convert a decimal number to its one’s complement representation, you can use the following formula:

- If the number is positive, convert the magnitude of the number to binary form.
- If the number is negative, find the one’s complement of its positive equivalent.

To convert one’s complement representation back to decimal form, you can use the following formula:

- If the sign bit is 0, convert the remaining bits to decimal form.
- If the sign bit is 1, find the one’s complement of the remaining bits and add a negative sign to the result.

## Need

The 1’s complement number system is an alternate method for representing signed integers in digital systems. While the 2’s complement number system is more commonly used, there are still some needs for the 1’s complement number system, including:

- Representation of negative numbers: Like the 2’s complement number system, the 1’s complement number system allows for the representation of negative integers.
- Addition and subtraction: The 1’s complement number system can simplify addition and subtraction operations for signed integers, making it useful in some applications.
- Compatibility: The 1’s complement number system is still supported by some older digital systems and programming languages, making it necessary for some legacy applications.
- Complement arithmetic: The 1’s complement number system provides a simpler method for performing complement arithmetic, which is used in some applications such as error detection.
- Range of numbers: The range of numbers that can be represented using 1’s complement notation is the same as for 2’s complement, which makes it suitable for some applications.

## Applications

- Computer science and programming
- Digital electronics and telecommunications
- Image processing and analysis
- Financial modeling and analysis