Digital Lesson 3
Digital Lesson 3
Digital Electronics
DIE-221
2
LAST LESSON
o In the last lesson, we learnt about binary codes and
logic gates:
o Represented decimal numbers and characters with binary codes
o Constructed and described the logic symbols for various logical
operators and gates
o Constructed and explained the truth tables for the logic gates
3
INTENDED LEARNING OUTCOMES
By the end of this lesson, the student should be able
to:
o Simplify logic expressions & functions using Boolean
algebra
o Convert Boolean expressions into standard SoP and PoS
forms
o Simplify logic expressions & functions using K-Maps
4
REFERENCE MATERIALS
o Mafumbi S. (2022). Digital Electronics lecturer notes. (MUBAS)
o Mbewe, S.A (2021). Digital Electronics lecturer notes. (MUBAS)
o Ndjountche, T. (2016). Digital Electronics I Combinational logic
circuits. John Wiley &Sons, Inc.
o Mano M.M., Ciletti M.D. (2013) Digital Design: With an
Introduction to the Verilog HDL, 5th Edition, Pearson Education,
Inc.,
o Floyd, T. L. (2015). Digital Fundamentals. Pearson Education
Limited.
5
OUTLINE
• Boolean analysis of logic circuit
• Logic simplification using Boolean algebra
• Standard forms of Boolean algebra
• Standard SoP
• Standard PoS
• The Karnaugh map
• The three variable K-MAP
6
OUTLINE
• Four variable K-Map
• Cell adjacency
• K-Map SoP minimization
• Lesson summary
• Next Lesson
7
INTRODUCTION
8
BASIC DEFINITIONS
• A literal is a single variable within a term in its
complemented or uncomplemented form.
• A variable is a symbol used to represent an action, a
condition, or data.
• A term can be a sum term or a product term. A sum
term is produced by an OR operation while a product
term is produced by an AND .operation
• A Boolean function expresses the logical relationship
between binary variables.
9
BASIC DEFINITIONS
• A postulate is a statement that does not require to be
proved.
• A binary operator is a rule that assigns to each pair of
elements from set S, a unique element from S.
• A set is a collection of elements or objects having a
common property.
10
LAWS AND RULES OF BOOLEAN
ALGEBRA
Laws of Boolean Algebra
• Commutative, Associative, and Distributive laws are the same as in
ordinary algebra.
COMMUTATIVE LAWS
• It states that the order in which the variables are Ored or ANDed makes
no difference: 𝑨 + 𝑩 = 𝑩 + 𝑨 or AB = BA
11
LAWS AND RULES OF BOOLEAN
ALGEBRA
ASSOCIATIVE LAWS
• This law states that when ORing or ANDing more than
two variables, the result is the same regardless of the
grouping of the variables.
𝑨+ 𝑩+𝑪 = 𝑨+𝑩 +𝑪
or 𝑨 𝑩𝑪 = 𝑨𝑩 𝑪
12
LAWS AND RULES OF BOOLEAN
ALGEBRA
DISTRIBUTIVE LAWS
• This law states that Oring two or more variables and
then ANDing the result with a single variable is
equivalent to ANDing the single variable with each of
the two or more variables and then Oring the products.
𝑨 𝑩 + 𝑪 = +𝑨𝑩 + 𝑨𝑪
13
LAWS AND RULES OF BOOLEAN
ALGEBRA
Rules of Boolean Algebra
14
DEMORGAN’S THEOREMS
• DeMorgan’s theorems provide mathematical
verification of the equivalency of the NAND and
negative-OR gates and that of NOR and negative-AND
gates.
• It is stated as:
the complement of a product of variables is equal to the sum
of the complements of the variables: 𝑿𝒀 = 𝑿 + 𝒀
OR
the complement of a sum of variables is equal to the product
of the complements of the variables: 𝑿 + 𝒀 = 𝑿𝒀
15
BOOLEAN ANALYSIS OF LOGIC
CIRCUITS
• Boolean algebra provides a concise way to express the
operation of a logic circuit formed by a combination of
logic gates so that the output can be determined for
various combinations of input values.
a) Deriving a Boolean expression for a Logic circuit
(Analysis procedure)
b) Constructing a truth table for a Logic circuit
c) Gate level implementation of a Boolean function
16
BOOLEAN ANALYSIS OF LOGIC
CIRCUITS
Analysis procedure
• Label all gate outputs that are a function of input
variables with arbitrary symbols and determine the
Boolean functions for each gate output;
• Label the gates that are a function of input variables
and previously labeled gates with other arbitrary
symbols and determine the Boolean functions for these
gates;
17
BOOLEAN ANALYSIS OF LOGIC
CIRCUITS
Analysis procedure
• Repeat the process outlined in step 2 until the outputs
of the circuit are obtained
• By repeated substitution of previously defined
functions, obtain the output; and
• Write Boolean functions in terms of input variables.
18
BOOLEAN ANALYSIS OF LOGIC
CIRCUITS
Analysis procedure Example
C 𝐹1 = 𝐶𝐷
D
𝐹2 = 𝐵 + 𝐶𝐷
B
𝑭 = 𝐴(𝐵 + 𝐶𝐷)
A
19
BOOLEAN ANALYSIS OF LOGIC
CIRCUITS
Constructing a Truth Table for a Logic
Circuit
• Once the Boolean expression or function for a given
logic circuit has been determined, a truth table that
shows the output for all possible values of the input
variables can be developed.
• The truth table can have up to 2𝑛 entries where n is the
number of input variables.
20
BOOLEAN ANALYSIS OF LOGIC
CIRCUITS
Constructing a Truth Table for a Logic
Circuit
• The binary combinations for the truth table are obtained
from the binary numbers by counting from 0 up to2𝑛 − 1
• To represent the function 𝑭 = 𝑨(𝑩 + 𝑪𝑫) in the truth
table;
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒𝑠 𝑐𝑜𝑚𝑏𝑖𝑛𝑎𝑡𝑖𝑜𝑛𝑠 = 2𝑛 = 24 = 16
• This implies a binary count from 0 to 15 and hence the
truth table is as shown on the next slide:
21
22
LOGIC SIMPLIFICATION USING
BOOLEAN ALGEBRA
• A logic expression can be reduced to its simplest form
or changed to a more convenient form to implement
the expression most efficiently using Boolean algebra.
• The approach taken in this section is to use the basic
laws, rules, and theorems of Boolean algebra to
manipulate and simplify an expression.
23
LOGIC SIMPLIFICATION USING BOOLEAN
ALGEBRA
EXAMPLE
• Using Boolean algebra techniques, simplify this
expression: 𝐴𝐵 + 𝐴 𝐵 + 𝐶 + 𝐵 𝐵 + 𝐶
𝐴𝐵 + 𝐴𝐵 + 𝐴𝐶 + 𝐵𝐵 + 𝐵𝐶
𝐴𝐵 + 𝐴𝐶 + 𝐵 + 𝐵𝐶
𝐴𝐵 + 𝐴𝐶 + 𝐵
𝑩 + 𝑨𝑪
• Students are advised to attempt logic
simplification questions given in the prescribed
text book.
24
END OF LESSON
Next Lesson
Standard Forms of Boolean Algebra
25
STANDARD FORMS OF BOOLEAN
ALGEBRA
• All Boolean expressions, regardless of their form, can
be converted into either of two standard forms: the
sum-of-products form or the product-of-sums form.
• Standardization makes the evaluation, simplification,
and implementation of Boolean expressions much
more systematic and easier.
26
THE SUM-OF- PRODUCTS FORM
• When two or more product terms are summed by
Boolean addition, the resulting expression is a sum-of-
products(SOP).
𝑨𝑩 + 𝑨𝑩𝑪
𝑨𝑩𝑪 + 𝑪𝑫𝑬 + 𝑩′ 𝑪𝑫′
• The domain of a general Boolean expression is the set
of variables contained in the expression in either
complemented or uncomplemented form.
27
THE SUM-OF-PRODUCTS (SoP)
FORM
• The domain of 𝐴′𝐵 + 𝐴𝐵′𝐶 is the set of variables A, B,
C
• The domain of 𝐴𝐵𝐶′ + 𝐶𝐷′𝐸 + 𝐵′ 𝐶𝐷 ′ is the set of
variables A, B, C, D, E.
• Implementing an SOP expression simply requires
Oring the outputs of two or more AND gates (AND/OR
Implementation)
• NAND gates can be used to implement an SoP
expression (NAND Implementation)
28
THE STANDARD SoP FORM
• A standard SoP expression is one in which all the
variables in the domain appear in each product
term in the expression
• Standardizing product terms follow the steps below:
i. Multiply each nonstandard product term by a term
made up of the sum of a missing variable and its
complement.
ii.Repeat step (i) until all product terms contain all
variables in the domain.
29
THE STANDARD SoP FORM
Example
Convert the following Boolean expression into standard
SoP form:
𝐴𝐵′ 𝐶 + 𝐴′ 𝐵′ + 𝐴𝐵𝐶 ′ 𝐷
30
THE STANDARD SoP FORM
Solution
𝐴𝐵′ 𝐶 = 𝐴𝐵′ 𝐶 𝐷 + 𝐷′ = 𝐴𝐵′ 𝐶𝐷 + 𝐴𝐵′ 𝐶𝐷 ′
𝐴′ 𝐵′ = 𝐴′ 𝐵′ 𝐶 + 𝐶 ′ = 𝐴′ 𝐵′ 𝐶 + 𝐴′ 𝐵′ 𝐶′ : D is missing
𝐴′ 𝐵′ 𝐶 + 𝐴′ 𝐵′ 𝐶 ′ = 𝐴′ 𝐵′ 𝐶 𝐷 + 𝐷 ′ + 𝐴′ 𝐵′ 𝐶 ′ 𝐷 + 𝐷 ′
= 𝐴′ 𝐵′ 𝐶𝐷 + 𝐴′ 𝐵′ 𝐶𝐷 ′ + 𝐴′ 𝐵′ 𝐶 ′ 𝐷 + 𝐴′ 𝐵′ 𝐶 ′ 𝐷′
The standardized SoP is:
𝑨𝑩′ 𝑪𝑫 + 𝑨𝑩′ 𝑪𝑫′ + 𝑨′ 𝑩′ 𝑪𝑫 + 𝑨′ 𝑩′ 𝑪𝑫′ + 𝑨′ 𝑩′ 𝑪′ 𝑫
+ 𝑨′ 𝑩′ 𝑪′ 𝑫′ + 𝑨𝑩𝑪′ 𝑫
31
THE STANDARD SoP FORM
Exercise
Convert the expression 𝑊𝑋 ′ 𝑌 + 𝑋 ′ 𝑌𝑍 ′ + 𝑊𝑋𝑌′ to
standard SoP form.
32
THE PRODUCT-OF-SUMS(PoS) FORM
• When two or more sum terms are multiplied, the
resulting expression is a product-of-sums (PoS)
𝐴′ + 𝐵 𝐴 + 𝐵′ + 𝐶
𝐴′ + 𝐵′ + 𝐶′ 𝐶 + 𝐷 ′ + 𝐶 𝐵′ + 𝐶 + 𝐷
• Implementing a PoS expression simply requires
ANDing the outputs of two or more OR gate.
33
THE STANDARD PoS FORM
• A standard PoS expression is one in which all
variables in the domain appear in each sum term in the
expression.
34
THE STANDARD PoS FORM
• Converting a sum term to standard PoS follows the
following procedure:
i. Add to each nonstandard product term a term made
up of the product of the missing variable and its
complement;
ii. Apply rule 𝐴 + 𝐵𝐶 = (𝐴 + 𝐵)(𝐴 + 𝐶)
iii. Repeat step 1 until all resulting terms contain all
variables in the domain.
35
THE STANDARD PoS FORM
Example
Convert the following Boolean expression into standard
POS form:
(𝐴 + 𝐵′ + 𝐶)(𝐵′ + 𝐶 + 𝐷 ′ )(𝐴 + 𝐵′ + 𝐶 ′ + 𝐷)
36
THE STANDARD PoS FORM
Solution
𝐴 + 𝐵′ + 𝐶 = 𝐴 + 𝐵′ + 𝐶 + 𝐷𝐷 ′
= 𝐴 + 𝐵′ + 𝐶 + 𝐷 𝐴 + 𝐵′ + 𝐶 + 𝐷′
𝐵′ + 𝐶 + 𝐷 ′ = 𝐵′ + 𝐶 + 𝐷 ′ + 𝐴𝐴′
= (𝐴 + 𝐵′ + 𝐶 + 𝐷 ′ )(𝐴′ + 𝐵′ + 𝐶 + 𝐷 ′ )
The standardized SOP is:
𝑨 + 𝑩′ + 𝑪 + 𝑫 𝑨 + 𝑩′ + 𝑪 + 𝑫′ (𝑨 + 𝑩′ + 𝑪 + 𝑫′ )(𝑨′
+ 𝑩′ + 𝑪 + 𝑫′ )(𝑨 + 𝑩′ + 𝑪′ + 𝑫)
37
THE STANDARD POS FORM
Exercise
Convert the expression (𝐴 + 𝐵′ )(𝐵 + 𝐶) to standard PoS
form.
38
STANDARD FORMS
NOTE:
• In standard SoP form, a complemented variable is a 0
in binary while a 1 is represented by an
uncomplemented variable
• In standard PoS form, a complemented variable is a 1
in binary while a 0 is represented by an
uncomplemented variable.
• Use DeMorgan’s law for conversion between SoP and
PoS forms
39
END OF LESSON
Next Lesson
The Karnaugh Maps
40
THE KARNAUGH MAP
• Gate-level minimization refers to the design task of
finding an optimal gate-level implementation of Boolean
functions describing a digital circuit: algebraic
simplifications, Karnaugh-Map
• A Karnaugh Map (K-Map) provides a systematic method
for simplifying Boolean expressions and, produces the
minimum expression
• It’s made up of squares, with each square representing a
minterm of the function to be implemented
• The minterms are arranged in a sequence similar to the
Gray code
41
THE KARNAUGH MAP
• It is similar to a truth table because it presents all of the
possible values of input variables and the resulting
output for each value.
• The number of cells in a K-Map, as well as in a truth
table, is equal to the total number of possible input
variable combinations: 2𝑛 .
42
THE THREE VARIABLE K-MAP
#𝑐𝑒𝑙𝑙𝑠 = 2𝑛
#𝑐𝑒𝑙𝑙𝑠 = 23
#𝑐𝑒𝑙𝑙𝑠 = 8
43
THE THREE VARIABLE K-MAP
#𝑐𝑒𝑙𝑙𝑠 = 2𝑛
#𝑐𝑒𝑙𝑙𝑠 = 23
#𝑐𝑒𝑙𝑙𝑠 = 8
44
THE FOUR VARIABLE K-MAP
#𝑐𝑒𝑙𝑙𝑠 = 2𝑛
#𝑐𝑒𝑙𝑙𝑠 = 24
#𝑐𝑒𝑙𝑙𝑠 = 16
45
CELL ADJACENCY
• The cells are arranged so that there is only a single
variable change between adjacent cells.
• Physically, each cell is adjacent to cells that are
immediately next to it on any of its four sides.
• A cell is not adjacent to the cells that diagonally touch
any of its corners.
46
CELL ADJACENCY
• Wrap around: cells in
the top row are adjacent
to the corresponding
cells in the bottom row
and the cells in the outer
left column are adjacent
to the corresponding
cells in the outer right
column.
47
K-MAP SoP MINIMIZATION
• This is done when the SoP is expressed in its standard
form.
• For an SoP expression in a standard form, a 1 is placed on
the K-Map for each product term in the expression.
• When the SoP is completely mapped, the number of 1s on
the K-Map equal to the number of product terms in the
standard.
• For a non standard SoP expression, you first convert
it to standard form and completely map it.
48
K-MAP SoP MINIMIZATION
To minimize, you group the 1’s according to the
following rules:
i. A group must contain either 1,2,4,8, or 16 cells: 2𝑛
ii. Each cell in a group must be adjacent to one or more
cells in that same group, but all cells in the group do not
have to be adjacent to each other
iii. Always include the largest possible number of 1’s in a
group
iv. Each 1 on the map must be included in at least one group
49
K-MAP SoP MINIMIZATION
In grouping the 1’s, the understanding of the
following terms is vital:
• An Implicant defines the adjacent squares that can be
potentially combined.
• A Prime Implicant is a product term obtained by combining
the maximum possible number of adjacent squares in the
map.
• A prime implicant is essential if it is the only prime implicant
that covers the minterm.
50
K-MAP SoP MINIMIZATION
EXAMPLE 1
Group the 1’s in each of the K-Maps:
51
Determine the product terms for each of the K-Maps
and write the minimum SoP expression
52
EXERCISE 1
Use the K-Map to minimize the following standard SoP
expression:
𝑨𝑩′ 𝑪 + 𝑨′ 𝑩𝑪 + 𝑨′ 𝑩′ 𝑪 + 𝑨′ 𝑩′ 𝑪′ + 𝑨𝑩′ 𝑪′
Solution
𝑩′ + 𝑨′ 𝑪
53
EXERCISE 2
Use the K-Map to minimize the following Boolean
expressions
i. 𝑥 ′ 𝑦 + 𝑦𝑧 ′ + 𝑦 ′ 𝑧′
ii. 𝐴′ 𝐵′ 𝐶 ′ + 𝐵′ 𝐶𝐷′ + 𝐴′ 𝐵𝐶𝐷′ + 𝐴𝐵′ 𝐶 ′
Nonstandard SoPs must be standardized first
Solutions
i. 𝒛′ + 𝒙′ 𝒚
ii. 𝑩′ 𝑫′ + 𝑩′ 𝑪′ + 𝑨′ 𝑪𝑫′
54
LESSON SUMMARY
In this lesson, we have:
o Simplified logic expressions & functions using Boolean algebra
o Converted Boolean expressions into standard SoP and PoS forms
o Simplified logic expressions & functions using K-Maps
55
NEXT LESSON
In the next lesson, we shall discuss:
o the process of designing combinational logic circuits
o Some function blocks of combinational logic circuits
56
THANK YOU
57