0% found this document useful (0 votes)
29 views50 pages

9s and 10s Complement

The use of 9's and 10's complements to perform subtraction as addition in the Decimal system.

Uploaded by

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

9s and 10s Complement

The use of 9's and 10's complements to perform subtraction as addition in the Decimal system.

Uploaded by

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

Complements

Complements can be used to perform subtraction


as addition.
We have 9’s & 10’s complements in decimal
system.
Why 9’s complement instead of 8’s complement?
How to find the 9’s complement?
What is the use of complements?
Is it used in computers?
Complements
Complements can be used to perform subtraction
as addition.
Digit 9’s
Complement
0 9
1 8
2 7
3 6
4 5
5 4
6 3
7 2
8 1
9 0
Complements
Subtract 2 from6.
We know that 6 – 2 = 4.
Complements
Subtract 2 from6.
We know that 6 – 2 = 4.
Using 9’s complements,
6 -2 can be written as 6 + (9’s complement of 2).
So, 6 -2 is written as
+
6
7
Complements
Subtract 2 from6.
We know that 6 – 2 = 4.
Using 9’s complements,
6 -2 can be written as 6 + (9’s complement of 2).
So, 6 -2 is written as
+
6
7 What is the result?
1 3
Complements
Perform 7-3.
Complements
Subtract 2 from6.
We know that 7 – 3 = 4.
Complements
Subtract 2 from6.
We know that 7 – 3 = 4.
Using 9’s complements,
7 -3 can be written as 7 + (9’s complement of 3).
So, 7 -3 is written as
7+
6
13 We get a carry. Add the carry to the LSD.
Complements
Subtract 2 from6.
We know that 7 – 3 = 4.
Using 9’s complements,
7 -3 can be written as 7 + (9’s complement of 3).
So, 7 -3 is written as
+
7
6
3 + We get a carry. Add the carry to the LSD.
1
4
Complements
Perform 67- 40.
Complements
Subtract 40 from 67.
We know that 67 – 40 = 27.
Complements
Subtract 40 from 67.
We know that 67 – 40 = 27.
Using 9’s complements,
67 -40 can be written as 67 + (9’s complement of
40).
Complements
Subtract 40 from 67.
We know that 67 – 40 = 27.
Using 9’s complements,
67 -40 can be written as 67 + (9’s complement of
40).
So, 67 - 59 is written as
+
67
59
123 + .
Complements
Subtract 40 from 67.
We know that 67 – 40 = 27.
Using 9’s complements,
67 -40 can be written as 67 + (9’s complement of
40).
So, 67 - 59 is written as
+
67
59
123 + We get a carry. What to do?
Complements
Subtract 40 from 67.
We know that 67 – 40 = 27.
Using 9’s complements,
67 -40 can be written as 67 + (9’s complement of 40).
So, 67 - 59 is written as
+
67
59
123 + We get a carry. Add the carry to the
LSD. 23
1
24
Complements
Perform 117 - 98.
Hint: Make the subtrahend and the minuend to
have the same number of digits.
Complements
Perform 4 - 8.
4 – 8 = 4 + 99’s complement of 8.
4 + 1 = 5. Is there a Carry?
No Carry means the result is negative. To get the
actual answer, we should find the 9’s complement
of the sum & prefix the sign as -.
9’s complement of 5 is 4. As this result is negative,
we prefix the minus sign. So, anwwer is -4.
Complements
Perform 12 - 56.
Complements
Perform 14.6 – 10.9
Complements
Perform 72.1 – 8.34
Complements
9’s complement addition to subtract was seen so
far.
There is another complement in the decimal
system.
It is called 10’s complements.
10’s complement = 9’s complement + 1.
What is the 10’s complement of 6?
= 9’s complement of 6 + 1
=3+1
=4
Complements
Find the 10’ complement of 7, 2, 9 & 0
10’s complement 0f 7 =
10’s complement 0f 2 =
10’s complement 0f 9 =
10’s complement 0f 0 =
What is the 10’ complement of 23 & 90?
10’s complement 0f 23 =
10’s complement 0f 90 =
Complements
Subtract 2 from 5 using 10’s complement.
Complements
Subtract 6 from 9 using 10’s complement.
Complements
Subtract 5 from 1 using 10’s complement.
Complements
In Decimal number system, we have 9’s & 10’s
complements?
What would be the corresponding complements
in the Binary number system?
Complements
In Decimal number system, we have 9’s & 10’s
complements?
What would be the corresponding complements
in the Binary number system?
1’s & 2’s complements!.
How would you find the 1’s complement of a
binary number.
Complements
In Decimal number system, we have 9’s & 10’s
complements?
What would be the corresponding complements
in the Binary number system?
1’s & 2’s complements!.
How would you find the 1’s complement of a
binary number.
Subtract each bit from 1.
1’s complement of 0 = 1
1’s complement of 1 = 0
Complements

1’s & 2’s complements!.


1’s complement of a binary number:
Subtract each bit from 1. Or replace 0 by 1 & 1 by 0.

1’s complement of 0 = 1
1’s complement of 1 = 0
Complements
Find the 1’s complement of the binary number
10012.
Complements
Find the 1’s complement of the binary number
10012.

1’s complement of the binary number


10012 = 01102
Complements
Find the 1’s complement of the binary number
110101102.

1’s complement of the binary number


110101102 = 001010012
Complements
Find the 1’s complement of the binary number
1) 110101102.
2) 110101102
3) 101010112
4) 111110012
5) 11100000.010012
Complements
Subtract 11 from 110.
110-
11
------
Normal Subtraction: 1’s complement subtraction
110- 110-
011 100
------ ------
Complements
Subtract 11 from 110.
110-
11
------
1’s complement subtraction:
110-
100
------
Complements
Subtract 112 from 1102.
110-
11
------
1’s complement subtraction:
110-
100
------
Complements
Subtract 10012 from 101102.
10110-
1001
---------
1’s complement subtraction:
10110-
01001
---------
Complements
Subtract 110002 from 10112.
11000-
1011
---------
1’s complement subtraction:
10110-
01001
---------
Complements
Subtract 110.012 from 1.0112.
110.01-
1.011
-----------
1’s complement subtraction:
110.01-
1.011
------------
Complements
Perform the following subtraction (using 1’s
complement) in binary:
1) 110012 – 100.0012
2) 11.1012 – 1.1012
3) 111.0012 – 0.001012
4) 1010.1112 – 10.0112
5) 1216 - 128
Complements
Decimal System Complements: 9 (Why 9?)
Binary System Complements: 1 (Why 1?)

Decimal System Complements: 10


Binary System Complements: ?
Complements
Decimal System Complements: 10
(10’s complement = 9’s complement + 1)
Binary System Complements: 2
(2’s Complement = 1’s complement + 1)

What is the 2’s complement of 1?


2’s Complement of 1 = 1’s complement of 1 + 1
2’s Complement of 1 = 0 + 1
2’s Complement of 1 = 1
Complements

What is the 2’s complement of 10?


2’s Complement of 10 = 1’s complement of 10 + 1
2’s Complement of 10 = 01 + 1
2’s Complement of 10 = 10
Complements

What is the 2’s complement of 101?


2’s Complement of 101 = 1’s complement of 101+ 1
2’s Complement of 101 = 010 + 1
2’s Complement of 101 = 11
Complements

What are the steps in the subtraction


(Complement addition)?
Complements
Perform the following binary subtraction using 2’s complement: 110102 -
11002
What are the steps in the subtraction?
1) Make the number of digits in the subtrahend equal to the minuend.
2) Find the 1’s complement of the subtrahend.
3) Add 1 to this 1’s complement.
4) Add the minuend with the 2’s complement of subtrahend.
5) If there is a Carry, what should you do?
6) If there is no Carry, the result is –ve & is in 2’s complement.
Complements
Perform the following binary subtraction using 2’s complement: 1101 2 - 11002
What are the steps in the subtraction?
1) Make the number of digits in the subtrahend equal to the minuend.
11012 - 11002
2) Find the 1’s complement of the subtrahend. 00112
3) Add 1 to this 1’s complement. 01002
4) Add the minuend with the 2’s complement of subtrahend.
1101 +
1010
1110
4) If there is a Carry, what should you do? Ignore the Carry.

5) If there is no Carry, the result is –ve & is in 2’s complement.


11012 – 11002 = 11102
Complements
Perform the following binary subtraction using 2’s complement: 11010 2 - 11002

What are the steps in the subtraction?


1) Make the number of digits in the subtrahend equal to the minuend.
11012 - 011002
2) Find the 1’s complement of the subtrahend. 100112
3) Add 1 to this 1’s complement. 101002
4) Add the minuend with the 2’s complement of subtrahend.
11010 +
10100
101110
4) If there is a Carry, what should you do? Ignore the Carry.
110102 - 11002 = 011102
5) If there is no Carry, the result is –ve & is in 2’s complement.
Complements
Perform the following binary subtraction using 2’s complement: 11010 2 - 11002

What are the steps in the subtraction?


1) Make the number of digits in the subtrahend equal to the minuend.
11012 - 011002
2) Find the 1’s complement of the subtrahend. 100112
3) Add 1 to this 1’s complement. 101002
4) Add the minuend with the 2’s complement of subtrahend.
11010 +
10100
101110
4) If there is a Carry, what should you do? Ignore the Carry.
110102 - 11002 = 011102
5) If there is no Carry, the result is –ve & is in 2’s complement.
Complements
Perform the following binary subtraction using 2’s complement: 11010 2 - 11002

What are the steps in the subtraction?


1) Make the number of digits in the subtrahend equal to the minuend.
11012 - 011002
2) Find the 1’s complement of the subtrahend. 100112
3) Add 1 to this 1’s complement. 101002
4) Add the minuend with the 2’s complement of subtrahend.
11010 +
10100
101110
4) If there is a Carry, what should you do? Ignore the Carry.
110102 - 11002 = 011102
5) If there is no Carry, the result is –ve & is in 2’s complement.

You might also like