0% found this document useful (0 votes)
2 views

Lecture_4_

Uploaded by

anjalikannan8073
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture_4_

Uploaded by

anjalikannan8073
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EE200 DIGITAL LOGIC CIRCUIT DESIGN

The material covered in this class will be as follows:

• Complements
• Subtraction using complements.

Decimal number complements:

9’s complement of the decimal number N = (10n – 1) – N


= n (9’s) – N
i.e. {subtract each digit from 9}

Example Æ 9’s complement of 134795 is 865204

Similarly

1’s complement of the binary number N = (2n -1) – N = n (1’s) – N

Example Æ 1’s complement of 110100101 is 001011010


which can be obtained by replacing each one by a zero and each
zero by one.

r’s complement:

10’s complement of the decimal number N = 10n – N = (r-1)’s


complement + 1

Example Æ 10’s complement of 134795 is 865205

Example Æ find the 9’s and 10’s complements of 314700.

Answer Æ 9’s complement = 685299


10’s complement=685300

EE 200 Number Systems (12) Dr. M. M. Dawoud


Rule: To find the 10’s complement of a decimal number leave all
leading zeros unchanged. Then subtract the first non-zero digit
from 10 and all the remaining digits from 9’s.

The 2’s complement of a binary number is defined in a similar


way.

Example: Find the 1’s and 2’s complements of the binary


number 1101001101

Answer Æ 1’s complement is 0010110010


2’s complement is 0010110011

Example: Find the 1’s and 2’s complements of 100010100

Answer Æ 1’s complement is 011101011


2’s complement is 011101100

Subtraction using r’s complement:

To find M-N in base r, we add M + r’s complement of N

Result is M + (rn – N)

1) If M > N then result is M – N + rn (rn is an end carry and


can be neglected.

2) If M < N then result is rn –(N-M) which is the r’s complement


of the result.

Example: Subtract (76425 – 28321) using 10’s complements.

Answer Æ 10’s complement of 28321 is 71679

Then add Æ 76425


+ 71679
Discard 148104

EE 200 Number Systems (13) Dr. M. M. Dawoud


Therefore the difference is 48104 after discarding the end carry.

Example: subtract (28531 – 345920)

Answer Æ It is obvious that the difference is negative. We


also have to work with the same number of digits, when dealing
with complements.

10’s complement of 345920 is 654080

Then add Æ 028531


+ 654080
No end carry 682611

Therefore the difference is negative and is equal to the 10’s


complement of the answer.
Difference is Æ - 317389

The same rules apply to binary.

Example: subtract (11010011 – 10001100)

Answer Æ 2’s complement of 10001100 is 01110100

Then add Æ 11010011


+ 01110100
Discard 101000111

The difference is positive and is equal to 01000111

The same rules apply to subtraction using the (r-1)’s


complements. The only difference is that when an end carry is
generated, it is not discarded but added to the least significant
digit of the result. Also, if no end carry is generated, then the
answer is negative and in the (r-1)’s complement form.
EE 200 Number Systems (14) Dr. M. M. Dawoud
Example: Subtract (76425 – 28321) using 9’s complements.

Answer Æ 9’s complement of 28321 is 71678

Then add Æ 76425


+71678

148103
1
Difference
48104

Example: subtract (11010011 – 10001100) using 1’s complement.

Answer Æ 1’s complement of 10001100 is 01110011

Then add Æ 11010011


+ 01110011

101000110
1
Difference 101000111

EE 200 Number Systems (15) Dr. M. M. Dawoud

You might also like