- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# 1's Complement vs 2's Complement

Complements are used in digital computers in order to simply the subtraction operation and for the logical manipulations. For the Binary number (base-2) system, there are two types of complements: 1’s complement and 2’s complement.

## 1’s Complement of a Binary Number

There is a simple algorithm to convert a binary number into 1’s complement. To get 1’s complement of a binary number, simply invert the given number.

## 2’s Complement of a Binary Number

There is a simple algorithm to convert a binary number into 2’s complement. To get 2’s complement of a binary number, simply invert the given number and add 1 to the least significant bit (LSB) of given result.

## Differences between 1’s complement and 2’s complement

These differences are given as following below −

1’s complement | 2’s complement |
---|---|

To get 1’s complement of a binary number, simply invert the given number. | To get 2’s complement of a binary number, simply invert the given number and add 1 to the least significant bit (LSB) of given result. |

1’s complement of binary number 110010 is 001101 | 2’s complement of binary number 110010 is 001110 |

Simple implementation which uses only NOT gates for each input bit. | Uses NOT gate along with full adder for each input bit. |

Can be used for signed binary number representation but not suitable as ambiguous representation for number 0. | Can be used for signed binary number representation and most suitable as unambiguous representation for all numbers. |

0 has two different representation one is -0 (e.g., 1 1111 in five bit register) and second is +0 (e.g., 0 0000 in five bit register). | 0 has only one representation for -0 and +0 (e.g., 0 0000 in five bit register). Zero (0) is considered as always positive (sign bit is 0) |

For k bits register, positive largest number that can be stored is (2^{(k-1)}-1) and negative lowest number that can be stored is -(2^{(k-1)}-1). | For k bits register, positive largest number that can be stored is (2^{(k-1)}-1) and negative lowest number that can be stored is -(2^{(k-1)}). |

end-around-carry-bit addition occurs in 1’s complement arithmetic operations. It added to the LSB of result. | end-around-carry-bit addition does not occur in 2’s complement arithmetic operations. It is ignored. |

1’s complement arithmetic operations are not easier than 2’s complement because of addition of end-around-carry-bit. | 2’s complement arithmetic operations are much easier than 1’s complement because of there is no addition of end-around-carry-bit. |

Sign extension is used for converting a signed integer from one size to another. | Sign extension is used for converting a signed integer from one size to another. |

- Related Questions & Answers
- 2's complement notation
- 2's complement fractions
- 1's complement notation
- 1’s and 2’s complement of a Binary Number?
- One’s Complement
- Two’s Complement
- 8085 program to find 1's and 2's complement of 8-bit number
- 8085 program to find 1's and 2's complement of 16-bit number
- Previous number same as 1’s complement in C++
- 10’s Complement of a decimal number?
- 8085 program to find 2's complement of the contents of Flag Register
- Draw a Turing machine to find 2’s complement of a binary number
- Design a Moore machine to generate 1's complement of a binary number.
- Draw a Turing machine to find 1’s complement of a binary number
- Find One’s Complement of an Integer in C++

Advertisements