Two's complement is the standard representation of signed integers in digital systems and computer architecture. It is widely used to represent positive and negative binary numbers while simplifying binary arithmetic operations such as addition and subtraction.
- It is obtained by taking the 1's complement of a binary number and adding 1 to the least significant bit (LSB).
- It eliminates the two-zero representation problem, making arithmetic operations simpler and more efficient than earlier signed number representations.

How to Find 2's Complement
To find the 2's complement of a binary number, follow these steps:
- Write the binary number.
- Find its 1's complement by replacing every 0 with 1 and every 1 with 0.
- Add 1 to the least significant bit (LSB) of the 1's complement.
- The resulting binary number is the 2's complement.
Examples
Example 1
Binary Number: 1010011
Step 1: Find the 1's complement.
1010011 -> 0101100
Step 2: Add 1.
0101100
+ 1
---------
0101101
2's Complement = 0101101
Example 2 (Fractional Binary Number)
Binary Number: 00111.001
Step 1: Find the 1's complement.
00111.001 -> 11000.110
Step 2: Add 1 to the least significant fractional bit.
11000.110
+ .001
-----------
11000.111
2's Complement = 11000.111
Binary Representation in 2's Complement
In 2's complement representation:
- Positive numbers are stored in their original binary form.
- Negative numbers are represented by finding the 2's complement of the corresponding positive binary number.
The most significant bit (MSB) acts as the sign bit:
- 0 → Positive number
- 1 → Negative number

Sign Extension in 2's Complement
When increasing the number of bits, the sign bit (MSB) is copied into the newly added higher-order bits. This preserves the value of both positive and negative numbers.
| Decimal | 4-bit | 5-bit | 6-bit |
|---|---|---|---|
| +2 | 0010 | 00010 | 000010 |
| +7 | 0111 | 00111 | 000111 |
| -2 | 1110 | 11110 | 111110 |
| -7 | 1001 | 11001 | 111001 |
Binary Addition Using 2's Complement
Binary addition in 2's complement follows the rules of ordinary binary addition. Any carry generated beyond the most significant bit (MSB) is discarded.
| Number 1 | Number 2 | Result |
|---|---|---|
| 0010 (+2) | 1110 (-2) | 0000 (0) |
| 0111 (+7) | 1110 (-2) | 0101 (+5) |
| 1011 (-5) | 0011 (+3) | 1110 (-2) |
| 1111 (-1) | 1010 (-6) | 1001 (-7) |
Memory Overflow Check
An overflow occurs when the result of a binary addition cannot be represented within the available number of bits.
In 2's complement, overflow occurs when:
The carry into the sign bit is different from the carry out of the sign bit.
| Number 1 | Number 2 | Addition | Carry into Sign Bit | Carry out of Sign Bit | Overflow |
|---|---|---|---|---|---|
| 1011 (-5) | 1100 (-4) | (1)0111 | 0 | 1 | Yes |
| 0010 (+2) | 0110 (+6) | (0)1000 | 1 | 0 | Yes |
| 0111 (+7) | 1110 (-2) | (1)0101 | 1 | 1 | No |
| 1011 (-5) | 0011 (+3) | (0)1110 | 0 | 0 | No |