0% found this document useful (0 votes)
6 views

Lecture1 Fall24

Uploaded by

Hamza
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lecture1 Fall24

Uploaded by

Hamza
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 54

Lecture # 1

Introduction/Overview/Number
System/Truth table

By: Muhammad Zain


Uddin email:
[email protected]

M. ZAIN UDDIN 1
Digital Logic
Design
Muhammad Zain
Uddin
Lectur
er,
IBA
My
Introduction
Course Instructor
 Name : Muhammad Zain Uddin
 Qualification : PhD(IBA, in progress), MSCS (IBA), MCS (PAF-KIET, Equivalency course),BE(PAF-
KIET)
 Teaching Experience : Lecturer in IBA (2023-till date), PhD Scholar/Research Assistant in IBA
(2020-2023), Lecturer in PAF-KIET (2017-2019), Lab Instructor at PAF-KIET(2016-2017).
 Industry Experience/Business : CEO/Cofounder of CYBORG Innovation (2023) and ZAHIR.
 , IoT/Hardware Department Manager at Axon Solution (2021-2023),RnD Engineer at ALM
Associate (2020)
 Email :[email protected]

M. ZAIN UDDIN 3
About ZAHIR
Custom Tailoring Services for Pakistani Brands – Worldwide Delivery
If you're a fan of Pakistani fashion and want your favorite brands custom-stitched to your exact
specifications, look no further! We provide bespoke stitching services tailored to your unique style and
needs, with convenient worldwide delivery.
Contact us today to get started on your personalized wardrobe!
Insta: Zahir_tailoring WhatsApp: +923312840106 fb:thezahirTailoring website: za-hir.com
Text and
Reference

Books
Thomas Floyd, Digital logic fundamentals
• Morris Mano, “Computer
SystemArchitecture”, Pearson, 3rd Ed.
• Digital Design and Computer Architecture,
D.M. Harris and S.L. Harris, Morgan Kaufmann,
2013 (2nd Edition).
Criter
ia
• Final - 30 Marks
• Midterm - 20 Marks
• Projects - 15 Marks
• Quiz - 15 Marks (Min
• Assignme 6)
nt - 10 Marks (Min
• Labs 5)
- 15 Marks
Administrative
Rules/Policies
• Well discipline is expected from class.
• Toavoid disturbance to others, Mobile phones must be set to the
silentmode.
• Kindly follow the dress code policy define in student’s Handbook
• We will have some Pop-Quizzes (means without prior
announcement).
• Late submissions or email based or any other way except
lms submission of assignments/Labs are subject to no submission
at all.
• No concept of deadline extensions
• Copying is strictly prohibited.
ANY
QUESTION?
Principle of A p p lic atio
pro gr a m

Abstraction OS
n
s
S o ft w a re
O p e ratin
devi ce
g
drivers
Systems
in s tru c tio
Architecture
ns
registers
CAAL M i cro - da t a pa th

focus of this
arc h itectu s
re c o n tro lle

course
rsa d d e r s
Lo gi c
m e m orie
DLD Digita
s
AND
l gates
C ircu it NOT
sA n a l o gaam t epslifier
g s
C ircu it fi lters
s tra n s is to
Devices
rs
di o de s
P hysi cs electron
s
8
Sco
pe
The purpose of this course is that we:
◦Learn the principles of digital design
◦Learn to systematically debug increasingly complex designs
◦Design and build digital systems
◦Learn what’s under the hood of an electronic component

9
Digital Logic Design

? ?
Course
Overview
Subjects Building Blocks Theory
Combinational Logic AND, OR, NOT, XOR Boolean Algebra

Standard Modules Function of Arithmetics, Encoder,


combination logics Decoder, Mux, De-
Mux, Comparator
Sequential Network Flip flops, Latches Finite State Machine

System Design Data Paths, Control Methodologies


(Optional) Paths

10
Combinational Logic vs
Sequential Network
x1 x1
. .
. fi(x) . si fi(x,s)
. .
xn xn
CLK
Sequential Networks
Combinational logic: 1. Memory
yi = fi(x1,..,xn) 2. Time Steps (Clock)
t
yit = fi (x1t,…,xnt, s1t, …,sm )
t
t
t
sit+1 = gi(x1t,…,xn , s1 ,
…,sm )
Agenda of next
lecture


Number system
Number system conversion
 Truth Table
 Digital Input
 Logic Gates

M. ZAIN UDDIN 13
Types of number
system

Binary

Octal
 Hexa Decimal
 Decimal

M. ZAIN UDDIN 14
Decimal
numbers
In the decimal number systems each of the ten digits, 0 through 9, represents a certain
quantity. The position of each digit in a decimal number indicates the magnitude of the
quantity represented and can be assigned a weight. The weights for whole numbers are
positive powers of ten that increases from right to left, beginning with 10º = 1
……………10 10 10³ 10² 10¹ 10º
For fractional numbers, the weights are negative powers of ten that decrease from left
to right
beginning with 10¯¹.
10² 10¹ 10º . 10¯¹ 10¯² 10¯³ ……..
The value of a decimal number is the sum of digits after each digit has been multiplied
by its
weights as in following examples.
1. Express the decimal number 87 as a sum of the values of each digit.
Solution: the digit 8 has a weight of 10, which is 10 , as indicated by its position. The digit 7 has
a weight of 1, which is 10º, as indicated by its position.
87 = (8 x 10 ) + (7 x 10º) = (8 x 10) +
(7 x 1) = 87
Determine the value of each digit in 939
2. Express the decimal number 725.45 as a sum of the values of each digit.
725.45 = (7 x 10²) + (2 x 10¹) + (5 x 10º) + (4 x 10¯¹) +
(5 x 10¯²) = 700 + 20 + 5 + 0.4 + 0.05
BINARY
NUMBERS
The binary system is less complicated than the decimal system because it has only two digits, it
is a base-two system. The two binary digits (bits) are 1 and 0. The position of a 1 or 0 in a binary
number indicates its weight, or value within the number, just as the position of a decimal digit
determines the value of that digit. The weights in a binary number are based on power of two
as:
….. 2 2³ 2 2 2º . 2¯ 2¯ ……….
With 4 digits position we can count from zero to 15.In general, with n bits we can count up to a
number equal to 2ⁿ - 1.
Largest decimal number = 2ⁿ - 1
BINARY
NUMBERS
A binary number is a weighted number. The right-most bit is the least significant
bit (LSB) in a binary whole number and has a weight of 2º =1. The weights
increases from right to left by a power of two for each bit. The left-most bit is
the most significant bit (MSB); its weight depends on the size of the binary
number.
Decimal number Binary number

0 0 0 0 0
1 0 0 0 1

2 0 0 1 0

3 0 0 1 1

4 0 1 0 0

5 0 1 0 1

6 0 1 1 0

7 0 1 1 1

8 1 0 0 0

9 1 0 0 1

10 10 1 0

11 10 1 1

12 11 0 0

13 11 0 1

14 11 1 0

15 11 1 1
Binary-to-Decimal
Conversion
The decimal value of any binary number can be found by adding the weights of
all bits that are 1 and discarding the weights of all bits that are 0.
Example
Let’s convert the binary whole number 101101 to decimal.
Weight: 2 2 2 2
2 2º
Binary
101101=no:2 1 +02 1+ 21 +0 2º1= 32+8+4+1=45
Decimal-to-Binary Conversion
One way to find the binary number that is equivalent to a given decimal number is to
determine the set of binary weights whose sum is equal to the decimal number. For example
decimal number 9, can be expressed as the sum of binary weights as follows:
9 = 8 + 1 or 9 = 2³ + 2º
Placing 1s in the appropriate weight positions, 2³ and
2º, and 0s in the 2² and 2¹ positions determines the binary number for decimal 9.
2³ 2² 2¹ 2º
1 0 0 1 Binary number for nine
Hexadecimal
numbers
The hexadecimal number system has sixteen digits and is used primarily as a
compact way of displaying or writing binary numbers because it is very easy to
convert between binary and hexadecimal. Long binary numbers are difficult to
read and write because it is easy to drop or transpose a bit. Hexadecimal is
widely used in computer and microprocessor applications. The hexadecimal
system has a base of sixteen; it is composed of 16 digits and alphabetic
characters.
The maximum 3-digits hexadecimal number is FFF or decimal 4095 and
maximum 4-digit hexadecimal number is FFFF or decimal 65.535
Decimal Binary Hexadecimal
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E

15 1111 F
Binary-to-Hexadecimal
Conversion
Simply break the binary number into 4-bit groups, starting at the right-most bit and replace each
4-bit group with the equivalent hexadecimal symbol as in the following example.
Convert the binary number to hexadecimal:
1100101001010111
Solution:
1100 1010 0101 0111

C A 5 7 =
CA57
Hexadecimal-to-Decimal
Conversion
One way to find the decimal equivalent of a hexadecimal number is to first convert the
hexadecimal number to binary and then convert from binary to decimal.
Convert the hexadecimal number 1C to decimal:
1 C
0001 1100 = 2 + 2³ + 2² = 16 +8+4 = 28
Decimal-to-Hexadecimal
Conversion
Repeated division of a decimal number by 16 will produce the equivalent hexadecimal number,
formed by the remainders of the divisions. The first remainder produced is the least significant
digit (LSD). Each successive division by 16 yields a remainder that becomes a digit in the
equivalent hexadecimal number. When a quotient has a fractional part, the fractional part is
multiplied by the divisor to get the remainder.
Convert the decimal number 650 to hexadecimal by repeated division by 16.
650 = 40.625 0.625 x 16 = 10 = A (LSD)
16
40 = 2.5 0.5 x 16 = 8 = 8
16
2 = 0.125 0.125 x 16 = 2 2 (MSD)
=
16
The hexadecimal number is 28A
Octal
Numbers
Like the hexadecimal system, the octal system provides a convenient way to express binary
numbers and codes.
However, it is used less frequently than hexadecimal in conjunction with computers and
microprocessors to express binary quantities for input and output purposes.
The octal system is composed of eight digits, which are:
0, 1, 2, 3, 4, 5, 6, 7
To count above 7, begin another column and start over:
10, 11, 12, 13, 14, 15, 16, 17, 20, 21 and so on.
Counting in octal is similar to counting in decimal,
except that the digits 8 and 9 are not used.
Octal-to-Decimal
Conversion
Since the octal number system has a base of eight, each successive digit position is an increasing
power of eight, beginning in the right-most column with 8º. The evaluation
Of an octal number in terms of its decimal equivalent is accomplished by multiplying each digit
by its weight and summing the products.
Let’s convert octal number 2374 in decimal number.
Weight 8³
8² 8
8º Octal number
2 3 7
4
2374 = (2 x 8³) + (3 x 8²)
+ (7 x 8
Decimal-to-Octal
Conversion
A method of converting a decimal number to an octal number is the repeated division-by-8 method,
which is similar to the method used in the conversion of decimal numbers to binary or to hexadecimal.
Let’s convert the decimal number 359 to octal. Each successive division by 8 yields a remainder that
becomes a digit in the equivalent octal number. The first remainder generated is the least significant
digit (LSD).
359 = 44.875 0.875 x 8 = 7 (LSB)
8
44 = 5.5 0.5 x 8 = 4
8
5 = 0.625 x 8 = 5 (MSB)
0.625
8
The number is 547.
Octal-to-Binary
Conversion
Because each octal digit can be represented by a 3-bit binary number, it is very easy to convert
from octal to binary..
Octal/Binary Conversion
Octal Digit 0 1 2 3 4 5 6
7
Binary 000 001 010
011 100 101 110
Let’s convert the octal numbers 25 and 140.
111
2 5 1 4 0
010 101 001 100 000
Binary-to-Octal
Conversion
Conversion of a binary number to an octal number is the reverse of the octal-to-binary
conversion.
Let’s convert the following binary numbers to octal:
110 101 101 111 001
6 5 = 65 5 7 1 = 571
Truth
Table
On Board
A(4) B(2) C(1)
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

M. ZAIN UDDIN 33
Review of previous lecture
Number system
Number system conversion
Truth Table
Digital Input
Logic Gates

M. ZAIN UDDIN 35
Types of Inputs
Example 1: Designing a circuit which takes 4 individual sensor from tank that gives digital
values and tell how many sensors are high on 7 segment display
Example 2: Designing a circuits that takes two input of 2 bits each and determine the product
of these two inputs in binary

M. ZAIN UDDIN 36
Basic Designing Rules
Step 1: identify number of inputs and individual input bits
Step 2: draw truth table if total number of inputs bits
Step 3: identify number of outputs and output bits
Step 4: Identify output value on each combination of inputs
Remaining steps will be discussed later

M. ZAIN UDDIN 37
Example 1
As per step total inputs are four and individual bits of
each input is one so total number of bits are 4.

Here alphabets represents each individual input and


total 4 bits of inputs will make 16 combination where
n represents total number of input bits

But in this example not all input combination are valid


so we will generate outputs for only those inputs
which are valid and remaining will be considered as
don’t care

M. ZAIN UDDIN 38
Example 1 (Cont.):
Inputs Inputs outputs
Outputs
A B C D a b c d e f g
0 0 0 1 0 1 1 0 0 0 0
0 0 1 1 1 1 0 1 1 0 1
0 1 1 1 1 1 1 1 0 0 1
1 1 1 1 0 1 1 0 0 1 1

M. ZAIN UDDIN 39
Example 2
As per step one total inputs are two and individual
bits of each input is two so total number of bits are 4.

Here alphabets represents each individual input and


total 4 bits of inputs will make 16 combination where
n represents total number of input bits but in this
example the inputs are in combination

In this example not all input combination are valid no


don’t care.

In This example we calculate total number if inputs by


taking maximum output possibility so 11*11 i.e., 3*3
is equals to 1001 i.e., 9 so one output of 4 bits

M. ZAIN UDDIN 40
Example 2

M. ZAIN UDDIN 41
Practical Implementation of the Basic
Logic Functions

Using Switches
Input/Output Definitions
• Input:
 logic 1 is switch closed
 logic 0 is switch open
• Output:
 logic 1 is lamp on
 logic 0 is lamp off.

 Functions depend on the definitions! (see Positive and


Negative in Unit 3)
 Avoid ambiguities – What does it mean when the result of a
medical test is positive?

42
Practical Implementation of Logic
Functions: Evolution of Switches in
Computers
 Earliest electromechanical computers had switches that opened and closed by
magnetic fields produced through energizing coils in relays
 Later, electronic vacuum tubes replaced relays.
 Later, discrete transistors replaced tubes
 Later, computers were constructed of many integrated circuits (IC), each containing many
transistors
 Nowadays whole processors are made of a
single chip. The Itanium 2 Intel processor

chip contains 1.72 billion transistors


12
Practical Implementation of the Basic Logic Functions

Using Transistor

M. ZAIN UDDIN 44
Logic Gates
There are total seven logic gates
AND
OR Basic logic gates any circuitry can be built using these three
NOT
XOR
NAND
NOR
XNOT
Universal gates means all logical gates can be built using these two gates

M. ZAIN UDDIN 45
M. ZAIN UDDIN 46
Definition of each gate
AND: If all inputs are high output will be high
OR: if minimum one input is high output will be high
NOT: opposite or inverted of inputs (in this logic input bits are equal to output bits)
NAND: If minimum one input is low output will be high
NOR: If all inputs are low output will be high
XOR: If high inputs are odd output will be high
XNOR: If high inputs are even output will be high

M. ZAIN UDDIN 47
Introduction to Boolean Algebra
From now onwards you will follow these basic rules to write Boolean expression which will lead
you to design
 Now Dot sign “.” will represent AND logic and any input that goes through aND gate will have
“.” between them.
Now plus sign “+” will represent OR logic and any input that goes through OR gate will have
“+” between them.
Now Bar sign “” on any alphabet or group alphabets will represents NOT sign.
If bar Sign is on another symbol i.e., “+”, “.”, “⊕” will represent negative gate that is NAND,
NOR, XNOR.
A single output can be represented by single Alphabet or may be multiple alphabets with
symbol

M. ZAIN UDDIN 48
Boolean Standard of Expression
Standard Sum-of-Products (SOP) form:
equations are written as an OR of AND terms.
Basic Rules:
Only consider high values of output
At each high value of output determine input
variable in Product for which A means high input and
means low value of input.
After considering all high values product now sum
each product to determine final expression
e.g.

M. ZAIN UDDIN 49
Example Circuit

M. ZAIN UDDIN 50
Boolean Standard of Expression
Standard Product-of-Sums (POS) form:
equations are written as an AND of OR terms
Basic Rules:
Only consider Low values of output
At each Low value of output determine input
variable in sum form in which A means Low input
and means High value of input.
After considering all low values of sum now
product each sum to determine final expression
e.g.

M. ZAIN UDDIN 51
Example Circuit
Basic Designing Rules
Step 1: identify number of inputs and individual input bits
Step 2: draw truth table if total number of inputs bits
Step 3: identify number of outputs and output bits
Step 4: Identify output value on each combination of inputs
Step 5: Now determine Boolean expression of each output bit.
Remaining steps will be discussed later

M. ZAIN UDDIN 53
Next Lecture
Different examples of circuit using SOP and POS
Circuitry costing and decision making.
Boolean Rules and Laws
Minimizing circuitry using those rules and laws

M. ZAIN UDDIN 54

You might also like