Chapter 4 Digital Logic Design
Chapter 4 Digital Logic Design
[EEng-2042 ]
Chapter Four:
Boolean Algebra and Logic Simplification
Outline
Boolean Operation and Expression
Boolean Algebra
Boolean Functions and Truth Tables
Standard and Canonical forms of Boolean Algebra
Simplification of Boolean Functions:
✔ Algebraic Simplification
✔ Karnaugh Maps Or K-Maps
✔ Techniques for Minimal SOP and POS Forms
✔ The Use of Don’t Care Conditions
2
Boolean Operation and Expression
Boolean algebra is the mathematics of digital logic.
A basic knowledge of Boolean algebra is indispensable to the
study and analysis of logic circuits.
Boolean operations and expressions in terms of their
relationship to NOT, AND, OR, NAND, and NOR gates were
introduced.
3
Cont’d...
Variable, complement, and literal are terms used in Boolean algebra.
A variable is a symbol (usually an italic uppercase letter or word) used to
represent an action, a condition, or data.
Any single variable can have only a 1 or a 0 value.
The complement is the inverse of a variable and is indicated by a bar
over the variable (overbar).
4
Cont’d...
For example, the complement of the variable A is A.
If A = 1, then A = 0.
If A = 0, then A = 1.
The complement of the variable A is read as “not A” or “A bar.”
Sometimes a prime symbol rather than an overbar is used to denote the
complement of a variable;
5
Cont’d...
Boolean Addition
Boolean addition is equivalent to the OR operation.
The basic rules are illustrated with their relation to the OR gate in Figure
4.1.
Figure 4.1
6
Cont’d...
In Boolean algebra, a sum term is a sum of literals.
In logic circuits, a sum term is produced by an OR operation with no AND
operations involved.
Some examples of sum terms are
A+B
A+B
A+B+C
A+B+C+D
A sum term is equal to 1 when one or more of the literals in the term are 1.
A sum term is equal to 0 only if each of the literals is 0.
7
Cont’d...
Example 4.1 Determine the values of A, B, C, and D that make the sum term
A + B + C + D equal to 0.
For the sum term to be 0, each of the literals in the term must be 0.
A+B+C+D=0+1+0+1
=0+0+0+0
=0
8
Cont’d...
Boolean Multiplication
Boolean multiplication is equivalent to the AND operation.
The basic rules are illustrated with their relation to the AND gate in Figure
4–2.
Figure 4.2
9
Cont’d...
In Boolean algebra, a product term is the product of literals.
In logic circuits, a product term is produced by an AND operation with no
OR operations involved.
Some examples of product terms are
AB
AB
ABC
ABCD
A product term is equal to 1 only if each of the literals in the term is 1.
A product term is equal to 0 when one or more of the literals are 0.
10
Cont’d...
Example 4.2 Determine the values of A, B, C, and D that make the product
term ABCD equal to 1.
For the product term to be 1, each of the literals in the term must be 1.
Therefore, A = 1, B = 0 so that B = 1, C = 1, and D = 0 so that D = 1.
ABCD = 1 . 0 . 1 . 0
=1.1.1.1
=1
11
Laws and Rules of Boolean Algebra
Rules and laws that must be followed in order to properly apply Boolean
algebra.
12
Cont’d...
Commutative Laws
The commutative law of addition for two variables is written as
A+B=B+A
The commutative law of multiplication for two variables is
AB = BA
Associative Laws
The associative law of addition is written as follows for three variables:
A + (B + C) = (A + B) + C
The associative law of multiplication is written as follows for three variables:
A(BC) = (AB)C 13
Cont’d...
Distributive Law
The distributive law is written for three variables as follows:
A(B + C) = AB + AC
Rules of Boolean Algebra
Table 4–1 lists 12 basic rules that are useful in manipulating and
simplifying Boolean expressions.
Rules 1 through 9 will be viewed in terms of their application to logic
gates.
Rules 10 through 12 will be derived in terms of the simpler rules and the
laws previously discussed.
14
Cont’d...
15
Cont’d...
DeMorgan’s Theorems
DeMorgan, a mathematician who knew Boole, proposed two theorems that are an
important part of Boolean algebra.
DeMorgan’s first theorem is stated as follows:
✔ The complement of a product of variables is equal to the sum of the
complements of the variables.
Stated another way,
✔
The complement of two or more ANDed variables is equivalent to the OR of
the complements of the individual variables.
The formula for expressing this theorem for two variables is
XY = X + Y 16
Cont’d...
DeMorgan’s second theorem is stated as follows:
✔ The complement of a sum of variables is equal to the product of the
complements of the variables.
Stated another way,
✔ The complement of two or more ORed variables is equivalent to the
AND of the complements of the individual variables.
The formula for expressing this theorem for two variables is
X + Y = XY
17
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.
Boolean Expression for a Logic Circuit
To derive the Boolean expression for a given combinational logic circuit, begin at
the left-most inputs and work toward the final output, writing the expression for
each gate.
CD
B + CD
A(B + CD)
Figure 4.3 A combinational logic circuit showing the development of the Boolean expression for the output.
18
Cont’d...
Constructing a Truth Table for a Logic Circuit
Once the Boolean expression 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 procedure requires that you evaluate the Boolean expression for all
possible combinations of values for the input variables.
In the case of the circuit in Figure 4.3, there are four input variables (A, B,
C, and D) and therefore sixteen (24 = 16) combinations of values are
possible.
19
Cont’d...
Evaluating the Expression
In this case, the expression equals 1 only if A = 1 and B + CD = 1 because
A(B + CD) = 1 . 1 = 1
Now determine when the B + CD term equals 1. The term B + CD = 1 if
either B = 1 or CD = 1 or if both B and CD equal 1 because
B + CD = 1 + 0 = 1
B + CD = 0 + 1 = 1
B + CD = 1 + 1 = 1
The term CD = 1 only if C = 1 and D = 1.
20
Cont’d...
To summarize, the expression A(B + CD) = 1 when A = 1 and B = 1 regardless of the
values of C and D or when A = 1 and C = 1 and D = 1 regardless of the value of B.
The expression A(B + CD) = 0 for all other value combinations of the variables.
TABLE 4–2
Truth table for the logic circuit in Figure 4.3. Putting the Results in Truth Table Format
The first step is to list the sixteen input
variable combinations of 1s and 0s in a binary
sequence as shown in Table 4–2.
Next, place a 1 in the output column for each
combination of input variables that was
determined in the evaluation.
Finally, place a 0 in the output column for all
other combinations of input variables.
21
Standard and Canonical 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.
22
Cont’d...
The Sum-of-Products (SOP) Form
When two or more product terms are summed by Boolean addition, the
resulting expression is a sum-of-products (SOP).
Some examples are
AB + ABC
X = AB + BCD + AC
ABC + CDE + BCD
AB + ABC + AC
Figure 4.4 Implementation of the SOP expression AB + BCD + AC.
X = AB + BCD + AC
Figure 4.5 This NAND/NAND implementation is equivalent to the AND/OR in Figure 4.4. 23
Cont’d...
Conversion of a General Expression to SOP Form
Any logic expression can be changed into SOP form by applying Boolean
algebra techniques.
For example, the expression A(B + CD) can be converted to SOP form by
applying the distributive law:
A(B + CD) = AB + ACD
24
Cont’d...
A standard SOP expression is one in which all the variables in the
domain appear in each product term in the expression.
✔ For example, the expression ABC + ABD + ABCD has a domain made
up of the variables A, B, C, and D.
✔ A standard SOP of the above expression is
ABCD + ABCD + ABCD
✔ Standard SOP expressions are important in constructing truth
tables.
Any nonstandard SOP expression (referred to simply as SOP) can be
converted to the standard form using Boolean algebra.
25
Cont’d...
Converting Product Terms to Standard SOP
Each product term in an SOP expression that does not contain all the
variables in the domain can be expanded to standard form to include all
variables in the domain and their complements.
As stated in the following steps, a nonstandard SOP expression is
converted into standard form using Boolean algebra rule 6 (A + A = 1)
from Table 4–1:
✔ A variable added to its complement equals 1.
26
Cont’d...
Step 1:
Multiply each nonstandard product term by a term made up of the sum of a
missing variable and its complement.
This results in two product terms.
As you know, you can multiply anything by 1 without changing its value.
Step 2:
Repeat Step 1 until all resulting product terms contain all variables in the
domain in either complemented or uncomplemented form.
In converting a product term to standard form, the number of product
terms is doubled for each missing variable.
27
Cont’d...
Example Convert the following Boolean expression into standard SOP form:
ABC + AB + ABCD
ABCD + ABCD + A BCD + A BCD + A B CD + A B C D + ABCD
X = (A + B)(B + C + D)(A + C)
31
Cont’d...
Step 1:
Add to each nonstandard product term a term made up of the product of
the missing variable and its complement. This results in two sum terms.
As you know, you can add 0 to anything without changing its value.
Step 2:
Apply rule 12 from Table 4–1: A + BC = (A + B)(A + C)
Step 3:
Repeat Step 1 until all resulting sum terms contain all variables in the
domain in either complemented or uncomplemented form.
32
Cont’d...
Example Convert the following Boolean expression into standard POS form:
(A + B + C)(B + C + D)(A + B + C + D)
33
Cont’d...
Converting Standard SOP to Standard POS
The binary values of the product terms in a given standard SOP
expression are not present in the equivalent standard POS expression.
Also, the binary values that are not represented in the SOP expression
are present in the equivalent POS expression.
34
Cont’d...
To convert from standard SOP to standard POS, the following steps are taken:
Step 1:
Evaluate each product term in the SOP expression. That is, determine the
binary numbers that represent the product terms.
Step 2:
Determine all of the binary numbers not included in the evaluation in Step 1.
Step 3:
Write the equivalent sum term for each binary number from Step 2 and
express in POS form.
Using a similar procedure, you can go from POS to SOP.
35
Cont’d...
Example 4.19 Convert the following SOP expression to an equivalent POS
expression:
A B C + ABC + ABC + ABC + ABC
The evaluation is as follows: 000 + 010 + 011 + 101 + 111
Since there are three variables in the domain of this expression, there are a total
of eight (23) possible combinations.
The SOP expression contains five of these combinations, so the POS must
contain the other three which are 001, 100, and 110.
Remember, these are the binary values that make the sum term 0.
The equivalent POS expression is
(A + B + C)(A + B + C)(A + B + C)
36
Boolean Expressions and Truth Tables
All standard Boolean expressions can be easily converted into truth
table format using binary values for each term in the expression.
The truth table is a common way of presenting, in a concise format, the
logical operation of a circuit.
Also, standard SOP or POS expressions can be determined from a truth
table.
37
Cont’d...
Converting SOP Expressions to Truth Table Format
A truth table is simply a list of the possible combinations of input
variable values and the corresponding output values (1 or 0).
For an expression with a domain of two variables, there are four different
combinations of those variables (22= 4).
For an expression with a domain of three variables, there are eight
different combinations of those variables (23 = 8).
For an expression with a domain of four variables, there are sixteen
different combinations of those variables (24 = 16), and so on.
38
Cont’d...
The first step in constructing a truth table is to list all possible
combinations of binary values of the variables in the expression.
Next, convert the SOP expression to standard form if it is not already.
Finally, place a 1 in the output column (X) for each binary value that
makes the standard SOP expression a 1 and place a 0 for all the
remaining binary values.
39
Cont’d...
Example Develop a truth table for the standard SOP expression
ABC + ABC + ABC.
40
Cont’d...
Converting POS Expressions to Truth Table Format
To construct a truth table from a POS expression, list all the possible
combinations of binary values of the variables just as was done for the
SOP expression.
Next, convert the POS expression to standard form if it is not already.
Finally, place a 0 in the output column (X) for each binary value that
makes the expression a 0 and place a 1 for all the remaining binary values.
41
Cont’d...
Example: Determine the truth table for the following standard POS
expression: (A + B + C)(A + B + C)(A + B + C)(A + B + C)(A + B + C)
42
Cont’d...
Determining Standard Expressions from a Truth Table
To determine the standard SOP expression represented by a truth table,
list the binary values of the input variables for which the output is 1.
Convert each binary value to the corresponding product term by
replacing each 1 with the corresponding variable and each 0 with the
corresponding variable complement.
43
Cont’d...
For example, the binary value 1010 is converted to a product term as
follows:
1010 ABCD
If you substitute, you can see that the product term is 1:
ABCD = 1 . 0 . 1 . 0 = 1 . 1 . 1 . 1 = 1
To determine the standard POS expression represented by a truth table,
list the binary values for which the output is 0.
Convert each binary value to the corresponding sum term by replacing
each 1 with the corresponding variable complement and each 0 with the
corresponding variable.
44
Cont’d...
For example, the binary value 1001 is converted to a sum term as follows:
1001 A+B+C+D
If you substitute, you can see that the sum term is 0:
A+B+C+D
1+0+0+1
0+0+0+0=0
45
Cont’d...
Example From the truth table in Table 4–8, determine the standard SOP
expression and the equivalent standard POS expression.
46
Cont’d...
There are four 1s in the output column and For the POS expression, the output is 0 for
the corresponding binary values are 011, binary values 000, 001, 010, and 101.
100, 110, and 111. Convert these binary values to sum terms as
follows:
Convert these binary values to product
terms as follows:
48
Cont’d...
Algebraic Simplification
The approach taken in this section is to use the basic laws, rules, and
theorems of Boolean algebra to manipulate and simplify an expression.
This method depends on a thorough knowledge of Boolean algebra and
considerable practice in its application, not to mention a little ingenuity
and cleverness.
49
Cont’d...
Algebraic Simplification
Example Using Boolean algebra techniques, simplify this expression:
AB + A(B + C) + B(B + C) B + AC
52
Cont’d...
The number of cells in a Karnaugh map, as well as the number of rows
in a truth table, is equal to the total number of possible input variable
combinations.
For three variables, the number of cells is 23 = 8.
For four variables, the number of cells is 24 = 16.
53
Cont’d...
The 3-Variable Karnaugh Map
The 3-variable Karnaugh map is an array of eight cells.
In this case, A, B, and C are used for the variables although other letters could
be used.
Binary values of A and B are along the left side
(notice the sequence) and the values of C are across
the top.
For example, the cell in the upper left corner has a
binary value of 000 and the cell in the lower right
corner has a binary value of 101.
Figure ( b) shows the standard product terms that
are represented by each cell in the Karnaugh map.
( a) ( b)
Figure 4.8 A 3-variable Karnaugh map showing Boolean product terms for each cell. 54
Cont’d...
The 4-Variable Karnaugh Map
The cells in a Karnaugh map are arranged so that there is only a single-variable
change between adjacent cells.
Binary values of A and B are along the left side and the values of C and D are
across the top.
The value of a given cell is the
binary values of A and B at the left
in the same row combined with the
binary values of C and D at the top
in the same column.
For example, the cell in the upper
right corner has a binary value of
00 I 0 and the cell in the lower right b
corner has a binary value of 1010. a
Figure 4.9 A 4-variable Karnaugh map. 55
Cont’d...
Cell Adjacency
The cells in a Karnaugh map are arranged so that there is only a single-
variable change between adjacent cells.
Adjacency is defined by a single-variable change.
In the 3-variable map the 010 cell is adjacent to the 000 cell, the 011 cell,
and the 110 cell.
The 010 cell is not adjacent to the 001 cell, the 111 cell, the 100 cell, or
the 101 cell.
Cells that differ by only one variable are adjacent.
56
Cont’d...
Cell Adjacency
Cells with values that differ by more than one variable are not adjacent.
Physically, each cell is adjacent to the 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.
Also, the 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.
Although the same rules for adjacency apply to Karnaugh maps with any
number of cells.
57
Cont’d...
Karnaugh Map SOP Minimization
The Karnaugh map is used for simplifying Boolean expressions to their
minimum form.
A minimized SOP expression contains the fewest possible terms with the
fewest possible variables per term.
Generally, a minimum SOP expression can be implemented with fewer
logic gates than a standard expression.
The cells that do not have a 1 are the cells for which the expression is 0.
Usually, when working with SOP expressions, the 0s are left off the map.
58
Cont’d...
Mapping a Standard SOP Expression
The following steps and the illustration in Figure 4.10 show the mapping
process.
Step 1: Determine the binary value of each product term in the standard SOP
expression. After some practice, you can usually do the evaluation of
terms mentally.
59
Cont’d...
Figure 4.10
Example Map the following standard SOP expression on a Karnaugh map:
1. A BC + A B C + AB C + ABC
2. A BCD + AB C D + ABCD + ABCD + ABC D + A B CD + ABC D
60
Cont’d...
Mapping a Nonstandard SOP Expression
A Boolean expression must first be in standard form before you use a
Karnaugh map.
If an expression is not in standard form, then it must be converted to
standard form by numerical expansion.
Example Map the following SOP expression on a
Karnaugh map:
A + AB + ABC
1. A + AB + ABC
000 100 110
2. B C + AB + ABC + ABCD + A B CD + ABCD
001 101
010
011 Figure 4.11
61
Cont’d...
Karnaugh Map Simplification of SOP Expressions
The process that results in an expression containing the fewest possible
terms with the fewest possible variables is called minimization.
After an SOP expression has been mapped, a minimum SOP expression is
obtained by grouping the 1s and determining the minimum SOP
expression from the map.
62
Cont’d...
Grouping the 1s
You can group 1s on the Karnaugh map according to the following rules by enclosing
groups.
1. A group must contain either 1, 2, 4, 8, or 16 cells, which are all powers of two. In the
case of a 3-variable map, 23 = 8 cells is the maximum group.
2. 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.
3. Always include the largest possible number of 1s in a group in accordance with rule 1.
4. Each 1 on the map must be included in at least one group. The 1s already in a group
can be included in another group as long as the overlapping groups include
noncommon 1s.
63
Cont’d...
Example Group the 1s in each of the Karnaugh maps in Figure below.
Figure 4.12
64
Cont’d...
The groupings are shown in Figure 4.12. In some cases, there may be more
than one way to group the 1s to form maximum groupings.
Figure 4.13
65
Cont’d...
Determining the Minimum SOP Expression from the Map
When all the 1s representing the standard product terms in an expression are properly
mapped and grouped, the process of determining the resulting minimum SOP expression
begins.
The following rules are applied to find the minimum product terms and the minimum SOP
expression:
Step 1: Group the cells that have 1s. Each group of cells containing 1s creates one product term
composed of all variables that occur in only one form (either uncomplemented or
complemented) within the group.
Variables that occur both uncomplemented and complemented within the group are
eliminated.
Step 2: Determine the minimum product term for each group.
Step 3: When all the minimum product terms are derived from the Karnaugh map, they are
summed to form the minimum SOP expression. 66
Cont’d...
Example Determine the product terms for the Karnaugh map in Figure 4.15
and write the resulting minimum SOP expression.
B + AC + ACD
Figure 4.15
67
Cont’d...
“Don’t Care” Conditions
Sometimes a situation arises in which some input variable combinations
are not allowed.
For example, recall that in the BCD code covered in Chapter 2, there are
six invalid combinations: 1010, 1011, 1100, 1101, 1110, and 1111.
Since these unallowed states will never occur in an application involving
the BCD code, they can be treated as “don’t care” terms with respect to
their effect on the output.
That is, for these “don’t care” terms either a 1 or a 0 may be assigned to
the output; it really does not matter since they will never occur.
68
Cont’d...
The “don’t care” terms can be used to advantage on the Karnaugh map.
Figure 4.17 shows that for each “don’t care” term, an X is placed in the
cell.
Figure 4.16 Example of mapping directly from a truth table to a Karnaugh map. 69
Cont’d...
Figure 4.17 Example of the use of “don’t care” conditions to simplify an expression. 70
Cont’d...
Karnaugh Map POS Minimization
In the last section, you studied the minimization of an SOP expression using a Karnaugh
map.
The approaches are much the same except that with POS expressions, 0s representing the
standard sum terms are placed on the Karnaugh map instead of 1s.
Mapping a Standard POS Expression
For a POS expression in standard form, a 0 is placed on the Karnaugh map for each sum
term in the expression. Each 0 is placed in a cell corresponding to the value of a sum term.
For example, for the sum term A + B + C, a 0 goes in the 010 cell on a 3-variable map.
When a POS expression is completely mapped, there will be a number of 0s on the
Karnaugh map equal to the number of sum terms in the standard POS expression.
The cells that do not have a 0 are the cells for which the expression is 1.
71
Cont’d...
The following steps and the illustration in Figure 4–43 show the mapping process.
Step 1: Determine the binary value of each sum term in the standard POS expression.
This is the binary value that makes the term equal to 0.
Step 2: As each sum term is evaluated, place a 0 on the Karnaugh map in the
corresponding cell.
73
Cont’d...
The sum term for each blue group is shown in the figure and the resulting minimum
POS expression is
A(B + C)
Keep in mind that this minimum POS expression is equivalent to the original standard
POS expression.
Figure 4.38
74
Thank You !
75