Basic Electrical and Electronics Engineering: Unit IV: Digital Electronics

Complements

with Solved Example Problems

Complements are used in digital computers for simplifying the subtraction operation and for logical manipulation.

COMPLEMENTS

Complements are used in digital computers for simplifying the subtraction operation and for logical manipulation. There are two types of complements for each base 'r' system. The two methods are

 (i) r's complement

 (ii) (r-1)'s complement

For binary number, r = 2 and r-1 = 1, so the 1's complement of N is (2n - 1) - N. For r's complement of an n-digit number N in base r is defined as rn - N for N ≠ 0 and 0 for N = 0.

1's complement

The 1's complement of a binary number is obtained by change all 1's to zero and zeros to ones.

Problem: 35

Find I's complement of (10110)2

Solution:


(101 10)2 → 0 1 0 0 1

Problem: 36

Find I's complement of (110111)2

Solution:


(1 10 1 1 1)2 → (001 000)

2's complement:

The 2's complement is obtained by adding one to the 1's complement of the given number.

2's complement = 1's complement +1

Problem: 37

Find 2's complement of (10011)2

Solution:

1's complement

 

1's complement = 01100

2's complement 


2's complement = 01101

Problem: 38

Find 2's complement of (110110)2

Solution:

1's complement


2's complement 


 (110110)2 → 2's complement = (001010)

Basic Electrical and Electronics Engineering: Unit IV: Digital Electronics : Tag: : with Solved Example Problems - Complements