DLD Week#1

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 60

CE-215T: Digital Logic

Design
Jawaid Shabir
jshabir@ssuet.edu.pk

Computer Engineering Department


WEEK NO:01
Things to take care during the session….
Cellular phones would be in silent mode when you
enter my class.
SMS is strictly prohibited during class.
Late entry margin of 05 min only after the start of a
class.
Try to be punctual and revise what you study in class
on regular basis.
Things to take care during the session….
No assignment under any circumstances would be
accepted after the due date and time.
Class CR would collect the assignment and submit the
same in my office as and when he would be told to do
so.
No re-conduction of any Quiz or One-hour
examination in this course. KEEP THAT IN MIND
FIRMLY.
The Course
The course shall deal with the basics of logic, logic
design, and switching theory.
It is an extremely practical course and you would enjoy
the applications directly after studying the theory.
My approach would be to teach you the fundamentals
through advanced concepts in such a manner that you
could easily apply the theory to real-life scenarios to
devise solutions to practical problems.
Reference Books
Digital Fundamentals by Thomas Floyd, Tenth Edition
(or Ninth Edition)
Digital Principles and Applications by Donald P Leach,
Albert Paul Malvino, Goutam Saha, Seventh Edition
Digital Logic Design
We shall deal with logic gates, and the systems we
create with the help of logic gates to perform certain
functions in the electronic/electrical / electro-
mechanical devices that we use.
We shall be dealing with the number system at the
beginning and the basic logic gates upon which the
entire building of the switching theory is based.
How to begin?
There could be two approaches, first to start the
number system and then move to logic gates, second,
to briefly describe logic gates first and then move to
the number system.
We shall opt for the first approach since it helps us in
understanding the need to study logic gates.
The Number System
The number system forms the basics of any logic-
related or computer-related course.
We shall be dealing with different formats to perform
calculations and mechanisms to express these
calculations.
To start with the most suitable form shall be the
decimal number system that we use very frequently.
The Decimal Number Format

It has a base “10”.


Base? It could be defined as the basic value upon which the entire
calculation process is based.
The Decimal Number Format
The Decimal Number Format
The Binary System
It has only two digits of
notation, 1 and 0.
It has a base 2.
The Binary System
 The value of the bit is determined by its position in the
binary number.
The weight structure of binary
Binary to Decimal Conversion
Binary to Decimal Conversion
Decimal to Binary Conversion
Sum of weights method

 Let’s convert the number 9 into the binary form.


Decimal to Binary Conversion
Decimal to Binary Conversion
Repeated Division by 2 Method

Converting 12 to binary by the


divide by two methods.
Convert 19 and 45 to binary by divide by 2 method
Decimal to binary conversion fractions:
Sum of Weights method

 Decimal to binary conversion fractions: Repeated Multiply by 2 Method


Binary Arithmetic
• Addition
Binary Subtraction
Binary Subtraction
1’s Compliment of a Binary Number

• It’s just the inversion of all the bits of the original number at their respective
positions.
2’s Compliment

• Just add binary ‘1’ to the 1’s compliment of a number to get its 2’s
compliment!
Another Method for finding the 2’s Compliment
Do it yourself….
The Sign Bit

• Left most bit in a binary number represents the sign of that binary
number.
• A ‘1’ shall indicate a negative number and a ‘0’ would indicate a
positive binary number.
1’s Compliment Form

• For example, using 8 bits, the decimal number -25 is


expressed as the 1’s compliment of +25 (00011001), i.e
11100110
2’s Compliment Form
Example
Decimal Value of the Signed Numbers….example
Signed numbers in 1’s compliment
Signed numbers in 2’s compliment
Signed numbers in 2’s compliment
Addition of Signed Numbers
Addition of Signed Numbers

Both Numbers are Positive Positive number larger than the


negative number
Addition of Signed Numbers

Both Negative Numbers The Overflow Condition


Subtraction
Hexadecimal Numbers
conversion
Binary to Hexadecimal Conversion Hexadecimal to Binary Conversion
conversion
Hexadecimal to Decimal Conversion Hexadecimal to Decimal Conversion (Method 2)

• Multiply each digit of the


hexadecimal number with its weight
and sum all the values.
Decimal to Hexadecimal Conversion
The Octal Numbers
Decimal to Octal Conversion
Octal to Binary Conversion
Do it yourself
The Binary Coded Decimal (BCD) Format

• The 8421 Code is an example of the BCD code format where each digit is
expressed as a four-bit binary number.
• There are 16 symbols in all for such coding as with four bits you could only
access up to 16 symbols.
• Decimal to BCD conversion
Decimal to BCD Conversion &
BCD to Decimal Conversion
BCD Addition

• Add the four bits independently as per the rules of binary addition.
• If a result is equal to or greater than 9, its an invalid BCD number.
• Add 6 (0110) to the number and it is thus converted into a valid BCD number.
BCD Addition
BCD Addition
Do it yourself
The Gray Code

• A code that exhibits a single bit change from one code to the another in a
sequence.

The four-bit gray code table


Binary to Gray Code Generation
Gray to Binary Code Conversion
Example
Example

You might also like