You are on page 1of 19

Topic: Complement of

Numbers
UNIT : 1
Lecture No.: 4
Binary Addition
RULES:
Example:

Prepared By: Irfan Ahmad Pindoo 3


Binary Addition
RULES: Try Yourself
11001.101 + 101100.011

Prepared By: Irfan Ahmad Pindoo 4


Binary Subtraction
RULES:
Example:

Prepared By: Irfan Ahmad Pindoo 5


Binary Addition

RULES: Try Yourself


36 -12 in Binary

Prepared By: Irfan Ahmad Pindoo 6


QUICK QUIZ (POLL)
Q: 011010 - 001100
a) 11110
b) 01110
c) 01010
d) 01101

Prepared By: Irfan Ahmad Pindoo 7


Complement of Numbers
Complements are used in digital computers to simplify the subtraction operation and for
logical manipulation.
Leads to simpler, less expensive circuits to implement the operations.

Prepared By: Irfan Ahmad Pindoo 8


Complement of Numbers

Let us
start the
magic!

Prepared By: Irfan Ahmad Pindoo 9


Complement of Numbers

Complements

Diminished Radix
Radix Complement
Complement
(r’s complement)
{(r-1)’s complement}
r: denotes radix/base
Prepared By: Irfan Ahmad Pindoo 10
Complement of Numbers

Complements
10’s complement 9’s complement
Diminished Radix
Radix Complement
2’s complement Complement 1’s complement
(r’s complement)
{(r-1)’s complement}

8’s complement 7’s complement

16’s complement F’s complement

Prepared By: Irfan Ahmad Pindoo 11


Complement of Numbers
Diminished Radix Complement Radix Complement

Given a number N in base r having n Given a number N in base r having n


digits, the (r - 1)’s complement of N, i.e., digits, the (r - 1)’s complement of N, i.e.,
its diminished radix complement, is its diminished radix complement, is
defined as: defined as:
𝒓𝒏 − 𝟏 − 𝑵 𝒓𝒏 − 𝑵

Prepared By: Irfan Ahmad Pindoo 12


Complement of Numbers

9’s complement 10’s complement

Prepared By: Irfan Ahmad Pindoo 13


Complement of Numbers
QUICK QUIZ (POLL)
Q: 10’s complement of 6384 is:
a) 3615
b) 3616
c) 10000
d) 1000

Prepared By: Irfan Ahmad Pindoo 14


Complement of Numbers
QUICK QUIZ (POLL)
Q: 9’s complement of 012398 is:
a) 87601
b) 87602
c) 987601
d) 987602

Prepared By: Irfan Ahmad Pindoo 15


Complement of Numbers

1’s complement 2’s complement

For example:
Example:
• if n = 4, we have 24 = 100002 and 24 − 1 =
The 2’s complement of binary 101100 is
11112 . Thus, the 1’s complement of a binary
010011 + 1 = 010100
number is obtained by subtracting each digit from
and is obtained by adding 1 to the
1.
1’s‐complement value
• However, when subtracting binary digits from 1, we
can have either 1 - 0 = 1 or 1 - 1 = 0, which causes
the bit to change from 0 to 1 or from 1 to 0,
respectively.
Therefore, the 1’s complement of a binary number is
formed by changing 1’s to 0’s and 0’s to 1’s.

Prepared By: Irfan Ahmad Pindoo 16


Complement of Numbers
Diminished Radix Complement Radix Complement

Given a number N in base r having n Given a number N in base r having n


digits, the (r - 1)’s complement of N, i.e., digits, the (r - 1)’s complement of N, i.e.,
its diminished radix complement, is its diminished radix complement, is
defined as: defined as:
𝒓𝒏 − 𝟏 − 𝑵 𝒓𝒏 − 𝑵

Prepared By: Irfan Ahmad Pindoo 17


Complement of Numbers

1’s complement 2’s complement

Prepared By: Irfan Ahmad Pindoo 18


Complement of Numbers
Summary:

Prepared By: Irfan Ahmad Pindoo 19

You might also like