Finding 2’s compliment

  1. Write down the binary number: Make sure it has a fixed number of bits (e.g., 8 bits).
  2. Invert the digits: Change every 0 to 1 and every 1 to 0. This is known as taking the one’s complement of the number.
  3. Add one to the result: This final step gives you the two’s complement of the original binary number.

Example

Let’s find the two’s complement of the 8-bit binary number 00101100.

  1. Write down the binary number:
00101100
  1. Invert the digits (one’s complement):
11010011
  1. Add one to the inverted number:
11010011 + 1 = 11010100

So, the two’s complement of 00101100 is 11010100.

Explanation

  • Original binary number: 00101100
  • One’s complement: 11010011 (inverted digits)
  • Add 1: When you add 1 to 11010011, you get 11010100.

This result (11010100) is the two’s complement of the original binary number 00101100.

Leave a comment

Your email address will not be published. Required fields are marked *