You are on page 1of 18

ADITYA ENGINEERING COLLEGE (A)

Digital Circuits and Logic Design

Compliment Number system and Subtractions using


Compliments
By

B.V.V.L.KALA BHARATHI
Dept of ELECTRICAL AND ELECTRONICS ENGINEERING
Aditya Engineering College(A)
Surampalem.
Aditya Engineering College (A)

COMPLIMENT NUMBER SYSTEM


An alternative representation of numbers in a fixed radix(base)
system.
What is compliment?
The pairs of mutually additive inverse numbers are called complements
Uses:
Commonly used in mechanical calculators.
Complements are used in digital computers in order to simplify the
subtraction operation and for logical manipulations.
Used in Number theory.
Digital circuits and logic
8/24/20
design
Aditya Engineering College (A)

TYPES OF COMPLIMENTS :
If R is the base of the number system then that number can have two types
of compliments.
They are
• Radix compliment or R’s compliment
• Diminished Radix compliment or (R-1)’s compliment
For example ,
Binary number system is base 2 system ,so it has two compliments :
2’s compliment and 1’s compliment.
Decimal number system is base 10 system ,so it has two compliments : 10’s
compliment and 9’s compliment.
Digital circuits and logic
8/24/20
design
Aditya Engineering College (A)

General formula to find R’s and (R-1)’s COMPLIMENT


R’s COMPLIMENT of any number system = (Rn)10-N

(R-1)’s COMPLIMENT of any number system = {(Rn)10-1}-N

Where R = base of that number system


n =number of digits in the number
N=The given number.

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

R’s and (R-1)’s COMPLIMENT of Binary number system


Here base =2 so
(R-1)’s COMPLIMENT i.e., 1’s compliment = {(2n)10-1}-N

R’s COMPLIMENT i.e., 2’s compliment = (2n)10-N

Example: find 1’s compliment and 2’s compliment of binary number 10110012
Here N=1011001, n=7(no. of digits)
1’s compliment of 10110012= {(27)10- 1}-1011001
=12710- 10110012 =11111112- 10110012
=01001102
Digital circuits and logic
8/24/20
design
Aditya Engineering College (A)

Contd…
Similarly ,2’s compliment of 10110012= (27)10- 10110012
=12810- 10110012 =100000002-
10110012
=01001112
Short cut method:
For 1’s compliment of binary number: Alter 0’s and 1’s.
i.e., 1’s compliment of 10110012 =01001102
For 2’s compliment of binary number=1’s compliment of binary number+1
i.e., 2’s compliment of 10110012 =01001102 +1= 01001112

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

R’s and (R-1)’s COMPLIMENT of base 3 number system


Here base =3 so
(R-1)’s COMPLIMENT i.e., 2’s compliment = {(3n)10-1}-N

 R’s COMPLIMENT i.e., 3’s compliment = (3n)10-N

Example: find 2’s compliment and 3’s compliment of base 3 number 121 3

Here N=121, n=3(no. of digits)


2’s compliment of 1213= {(33)10- 1}-1213
=2610- 1610 =1010
=1013
Digital circuits and logic
8/24/20
design
Aditya Engineering College (A)

Contd…
Similarly ,
3’s compliment of 1213 = (33)10-1213
=2710- 1610 =1110
=1023

Short cut method:


For 2’s compliment of base 3 number: subtract each digit of the given number
from 2
i.e., 2’s compliment of 1213 =222-121=1013
For 3’s compliment of base 3 number=2’s compliment of binary number+1
i.e., 3’s compliment of 1213 = 1013+1=1023
Digital circuits and logic
8/24/20
design
Aditya Engineering College (A)

R’s and (R-1)’s COMPLIMENT of Decimal number system


Here base =10 so
(R-1)’s COMPLIMENT i.e., 9’s compliment = {(10n)10-1}-N

R’s COMPLIMENT i.e., 10’s compliment = (10n)10-N

Example: find 9’s compliment and 10’s compliment of decimal number 40010

Here N=400, n=3(no. of digits)


9’s compliment of 40010= {(103)10- 1}-40010
=99910- 40010 =59910

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

Contd…
Similarly ,
10’s compliment of 40010 = (103)10-40010
=1000- 40010 =60010

Short cut method:


For 9’s compliment of base 10 number: subtract each digit of the given number
from 9
i.e., 9’s compliment of 40010 =999-400=59910
For 10’s compliment of base 10 number=9’s compliment of decimal number+1
i.e., 10’s compliment of 40010 = 59910+1=60010
Digital circuits and logic
8/24/20
design
Aditya Engineering College (A)

Subtraction using Compliments


This can be done using
1.R’s compliment
2.(R-1)’s compliment
 Subtraction using R’s Compliment:
If M and N are two numbers of base R
then add M and R’s compliment of N
i.e., M-N= M+R’s compliment of NR
= M +(Rn-N)
Then 2 cases :
Case 1:If M>N, then the result is (M-N)+R n (Rn is end carry and this can be
discarded(neglected).
Case 2:If M<N,then the result is Rn -(N-M) which is the R’s compliment of the reult
Digital circuits and logic
8/24/20
design
Aditya Engineering College (A)

Case 1: when M>N

Therefore the difference is 48104 after discarding carry

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

Case 2: when M<N

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

Same rules applies to binary numbers……

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

 Subtraction using ( R-1)’s Compliment:


If M and N are two numbers of base R
then add M and (R-1)’s compliment of N
i.e., M-N= M+(R-1)’s compliment of NR
=M+(Rn-1)-N
then 2 cases :
Case 1:If M>N, End carry is generated and it is added to the LSB of the result.
Case 2:If M<N,then no end carry is generated and R-1’s compliment of the
result is abtained and result is negative.

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

Digital circuits and logic


8/24/20
design
Aditya Engineering College (A)

THANK YOU

Digital circuits and logic


design 8/24/20

You might also like