Uploaded by tasinstuff

Experiment 1

advertisement
EEE 304
– Digital
Electronics Laboratory
(Jan 2023)
Experiment 1 – Introduction to Basic Gates and
Logic Simplification Techniques
Presented by:
Shafin Bin Hamid
Lecturer
Department of Electrical and Electronics Engineering
Bangladesh University of Engineering and Technology
Mid Term Presentation (April 2021)
Outline
• Basic Boolean gates
• Boolean algebra
• Minimization using Boolean algebra
• Truth table to Sum of Products (SOP)
• Truth table to Product of Sums (POS)
• Minimization using Karnaugh map
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
2
Basic Boolean gates
AND
OR
NOT
In the absence of parentheses, the precedence of operation is
NOT > AND > OR
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
3
Boolean algebra
All theorems maintain duality. Replace +
with . and replace 1 with 0
Axioms
Single Variable
Thm.
Two/Three Variable Thm.
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
4
Minimization using Boolean algebra
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
5
Cost of an implementation
• The cost of a logic circuit is the total number of gates plus the total
number of inputs to all gates in the circuit
Cost of Implementation:
Total gates = 3+4+1 = 8
Total inputs = 3+3+3+3+3+4 = 19
Total = 27
Cost of Implementation:
Total gates = 2+2+1 = 5
Total inputs = 2+2+2+2 = 8
Total = 13
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
6
Sum of Products
• For a function of n variables, a
product term in which each of the
n variables appears once is called
a minterm.
• The variables may appear in a
minterm either in uncomplemented
or complemented form. For a
given row of the truth table, the
minterm is formed by including xi if
xi = 1 and by including ๐‘ฅเดฅ๐‘– if xi = 0
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
7
Sum of Products
• Any function f can be represented by a
sum of minterms that correspond to the
rows in the truth table for which f = 1
• The resulting implementation is
functionally correct and unique, but it is
not necessarily the lowest-cost
implementation of f .
• If each product term in a sum of
products expression, f is a minterm,
then the expression is called a
canonical sum-of-products for the
function f.
๐’‡ ๐’™๐Ÿ , ๐’™๐Ÿ , ๐’™๐Ÿ‘ = ๐’Ž๐Ÿ + ๐’Ž๐Ÿ’ + ๐’Ž๐Ÿ“ + ๐’Ž๐Ÿ”
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
8
Product of Sums
• It is also possible to synthesize f by considering the rows for which f = 0.
(from Principle of duality)
• This alternative approach uses the complements of minterms, which are
called maxterms.
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
9
NAND for SOP
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
10
NOR for POS
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
11
Karnaugh maps
• A systematic way of producing a minimum-cost logic expression
Two variable map
Four variable map
Three variable map
The least significant variables should be placed along the rows of the Karnaugh map
The adjacent combinations cannot differ by more than 1 bit, i.e. gray coding
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
12
Karnaugh map minimization (SOP)
Steps: Draw the K-map and place the 1’s according to the defined
function.
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
13
Karnaugh map minimization (SOP)
Then, find the largest groups of 1’s
that is a power of 2 (2,4,8,16 etc).
You need to make sure that the 1’s
are adjacent to each other.
Once you have found a group, you
will need to write the minterm for it.
Of x1, x2, x3 etc. some will remain
constant within the group and
some will change. Only those that
remain constant within the group
will appear in the minterm in either
complemented or
uncomplemented form.
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
14
Karnaugh map minimization (SOP)
• Continue doing this for all groups of 4
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
15
Karnaugh map minimization (SOP)
• Once groups of 4 are finished,
look for groups of 2
• Remember that for a group to
be valid, there needs to be at
least 1 non-common one inside
it
• Once all one’s have been
covered, just sum up the
minterms and you have the
minimum cost SOP
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
16
Karnaugh map minimization (POS)
• Most rules are same except now
instead of minterms we will have
maxterms and instead of grouping
ones, we will group zeros
• Eventually, we will multiply all the
maxterms to get minimum cost POS
• Remember that now if xn is 0, we will
take the uncomplemented form
(different from SOP)
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
17
Karnaugh map minimization (Don’t care terms)
Don’t care terms can be taken as 0 or 1 depending on SOP or POS
minimization
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
18
Reference
• Chapter 2, Stephen Brown, Zvonko Vranesic - Fundamentals of
Digital Logic with Verilog Design (3rd Edition)
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
19
EEE 304 (July 2022) – Experiment 1: Introduction to Basic Gates and Logic Simplification Techniques
© Shafin Bin Hamid
20
Download