1’s Complement & 2’s complement

1’s Complement & 2’s complement

Difference between 1’s complement and 2’s complement – Binary Number system

One’s Complement

The 1’s complement of a binary number is obtained by complementing all its bits, i.e. by replacing 0s with 1’s and 1’s with 0s.

Example: Find the one’s complement of (10010110)2

Solution:       

Replace 1’s by 0’s and 0’s by 1’s

The 1’s complement of (10010110)2 is (01101001)2.

Two’s Complement

The 2’scomplement of a binary number is obtained by adding 1’ to its 1’s complement.

Example: Find the one’s complement of (10010110)2

Solution:       Find the one’s complement by replacing 1’s by 0’s and 0’s by 1’s

(01101001)2.

To determine the 2’s complement add 1 to the one’s complement

The 2’s complement of (10010110)2 is (01101010)2.

We will be happy to hear your thoughts

Leave a reply

Arzcellent
Logo