• Practice
  • About 14 min
  • 5 practice questions

Binary arithmetic and complements

Add and subtract binary numbers and find the one's and two's complement.

If something looks wrong, please tell us.

Binary arithmetic follows the same logic as decimal arithmetic, only with two digits. The rules of addition are all you need to remember.

Addition rules

Binary addition
SumResult
0 + 00
0 + 11
1 + 01
1 + 110 (write 0, carry 1)
1 + 1 + 111 (write 1, carry 1)

Worked examples

Example 1. Add 1011 and 110. In decimal that is 11 + 6 = 17. In binary, align the digits: 1011 + 0110. From the right: 1+0=1; 1+1=0 carry 1; 0+1+1=0 carry 1; 1+0+1=0 carry 1; the final carry gives 1. Result 10001, which is 16 + 1 = 17.

Example 2. Subtract 101 from 10010. In decimal, 18 - 5 = 13. In binary the result is 1101 (8 + 4 + 1 = 13).

Complements

The one's complement of a binary number is found by flipping every bit. The two's complement is the one's complement plus 1, and it is used to represent negative numbers.

Example 3. Find the two's complement of 0101 (5) in 4 bits. One's complement: 1010. Add 1: 1011. This pattern represents -5 in a 4-bit system.

1 + 1 = 10 in binary. One's complement = flip all bits. Two's complement = flip, then add 1.

— Rule to remember

Key takeaways: carry on every 1 + 1, check using decimal, and use flip-then-add-1 for two's complement.

Check your understanding

  1. 1. Add binary 110 and 11.

    1. 1000
    2. 111
    3. 1001
    4. 1010
    Show answer

    Answer: C. 6 + 3 = 9. In binary: 0+1 = 1; 1+1 = 0 carry 1; 1+0+1 = 0 carry 1; final 1: 1001 = 8 + 1 = 9.

  2. 2. What is the one's complement of 1001101?

    1. 0110011
    2. 1001110
    3. 1011001
    4. 0110010
    Show answer

    Answer: D. Flip every bit: 1001101 becomes 0110010.

  3. 3. Subtract binary 110 from 10101.

    1. 1111
    2. 1101
    3. 11111
    4. 1011
    Show answer

    Answer: A. 10101 is 21 and 110 is 6; 21 - 6 = 15, which is 1111.

  4. 4. In 4 bits, what is the two's complement of 0111?

    1. 1000
    2. 1001
    3. 1010
    4. 0110
    Show answer

    Answer: B. Flip to 1000, then add 1: 1001. Check: 16 - 7 = 9, which is 1001. It represents -7.

  5. 5. Add binary 1110 and 1011.

    1. 11000
    2. 10101
    3. 11001
    4. 11101
    Show answer

    Answer: C. 14 + 11 = 25. In binary: 0+1 = 1; 1+1 = 0 c1; 1+0+1 = 0 c1; 1+1+1 = 1 c1; final 1: 11001 = 16 + 8 + 1 = 25.

Sign in to keep track of the lessons you finish.

Next lesson → Bits, bytes and how many values fit

Privacy · Terms · Refunds · Delivery