0% found this document useful (0 votes)
59 views30 pages

Digital Logic Design: Lecture 2 - Number Systems

This document discusses number systems and complements. It covers: - Converting between different number systems including binary, octal, decimal, and hexadecimal. - Finding the r's complement, (r-1)'s complement, 10's complement, 2's complement, 9's complement, and 1's complement of numbers. - Shortcuts for finding 10's, 2's, 9's, and 1's complements. - How to perform subtraction using complements by adding the minuend to the complement of the subtrahend and handling any carry.
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)
59 views30 pages

Digital Logic Design: Lecture 2 - Number Systems

This document discusses number systems and complements. It covers: - Converting between different number systems including binary, octal, decimal, and hexadecimal. - Finding the r's complement, (r-1)'s complement, 10's complement, 2's complement, 9's complement, and 1's complement of numbers. - Shortcuts for finding 10's, 2's, 9's, and 1's complements. - How to perform subtraction using complements by adding the minuend to the complement of the subtrahend and handling any carry.
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/ 30

Digital Logic Design

Lecture 2 - Number Systems


Syllabus.
Syllabus
Grading (relative grading system):
• Exams: 80% MTE1-20 marks
MTE2-20 marks
ETE-40 marks

• Assignment / quizzes / project: 15% (15 marks)

• Attendance etc: 5% (5 marks)


Lecture 3:
Number system continued.
1.(101101.011)2 = (?)10 2. (14.125)10 = (?)2
3. (743)8 = (?)10
4. (92)16 = (?)2 = = (?)8
5. Perform the arithmetic operation as below considering the
numbers to be in the (a) octal and (b) hexadecimal system.

a) 1776 + 1432 b) 57734 - 1066


6. Each of the following arithmetic operations is correct in at
least one number system. Determine possible radix of the
numbers in each operation.
(i) 1234 + 5432 = 6666 (ii) 41 / 3 = 13
• Ans1 = 45.375
• Ans2 = 1101.001
• Ans3 = 483
• Ans4 = 10010010 & 222
• Ans5 = 3430 & 56646
• Ans6 = >= 7 & 8
Lecture - 3
Complements
Complements are used for

Simplifying the subtraction operation

Logical Manipulation
Types:
• r’s complement

• (r-1)’s complement
r’s complement:
Given a positive number N in base r with an integer part of n digits:

{
𝑛
𝑟 𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡 = 𝑟 − 𝑁 𝑓𝑜𝑟 𝑁 ≠ 0

0 𝑓𝑜𝑟 𝑁 =0
10’s complement of (52520)10?

(10)5 – 52520 = 47480

10’s complement of (0.3267)10?

(10)0 – 0.3267 = 0.6733

10’s complement of (25.639)10?

(10)2 – 25.639 = 74.361


2’s complement of (101100)2?

(2)6 – 101100 = 010100

2’s complement of (0.0110)2?

(2)0 – 0.0110 = 0.1010


Shortcut to find out 10’s & 2’s complement:
• 10’s complement of a decimal number can be formed
by leaving all significant zeros unchanged. Subtracting
the first nonzero least significant digit from 10 and
then subtracting all other higher significant digits from
9.

• The 2’s complement can be formed by leaving all least


significant zeros and the first nonzero digit unchanged
and then replacing 1’s by 0’s and 0’s by 1’s in all other
higher significant digits.
The (r-1)’s complement:
Given a positive number N in base r with an integer part of n digits and a fractional part
of m digits:

The (r-1)’s complement of N is defined as: rn-r-m-N


9’s complement of (52520)10?

(10)5 - (10)0– 52520 = 47479

9’s complement of (0.3267)10?

(10)0 – (10)-4 - 0.3267 = 0.6732

10’s complement of (25.639)10?

(10)2 – (10)-3 - 25.639 = 74.360


1’s complement of (101100)2?

(2)6 –(2)-0 - 101100 = 010011

1’s complement of (0.0110)2?

(2)0 – (2)-4- 0.0110 = 0.1001


Shortcut to find out 9’s & 1’s complement:
• 9’s complement of a decimal number can be formed
simply by subtracting every digit from 9.

• The 1’s complement of a binary number can be formed


by replacing 1’s by 0’s and 0’s by 1’s.
Complement of the complement
It restores the original value

The r’s complement of N is rn-N

And the complement of (rn-N) is rn- (rn-N) = N


Subtraction with r’s complement
The subtraction of two positive numbers (M-N) both of base
r, may be done as follows

• Add the minuend M to the (r)’s complement of N.


• Inspect the resultant for the end carry.
a. if an end carry occurs, add 1 to the lsd (end around
carry)
b. If an end carry doesn’t occur, take the (r)’s complement
of the number obtained in step 1 and place a negative
sign in front.
(72532 - 3250)10 using 10’s complement
(1010100 - 1000100)2 using 2’s complement
Subtraction with r-1’s complement
The subtraction of two positive numbers (M-N) both of
base r, may be done as follows

• Add the minuend M to the (r-1)’s complement of N.


• Inspect the resultant for the end carry.
a. if an end carry occurs discard it,
b. If an end carry doesn’t occur, take the (r-1)’s
complement of the number obtained in step 1 and
place a negative sign in front.
(72532 - 3250)10 using 9’s complement
(1010100 - 1000100)2 using 1’s complement

You might also like