Topic 7
Logic Simplication
7.1 Introduction and Truth Tables
The basic specication of any digital system is the Truth Table. A truth table species all the
inputs and the corresponding outputs of a system - such inputs and outputs may be specied by a
client or a system designer. We have already seen truth tables for individual logic gates considered
before. Larger systems also have truth tables. In this chapter, we cover the simplication and
minimisation of logic circuits derived from Truth Tables. In this course, this is achieved using
two methods - (a) Boolean algebra method and (b) Karnaugh mapping method. This chapter
covers the laws, rules, and theorems of Boolean algebra and their application to digital circuit
minimisation. The chapter goes on to explain how to draw Karnaugh maps and use them to
minimise logic expressions and hence circuits.
7.2 Boolean Expressions and Truth Tables
Boolean algebra is the mathematics of digital systems. In this section we shall try to do the
following:
(a) Dene a Boolean variable - A variable is a symbol (usually an italic uppercase letter) used
to represent a logical quantity. The complement is the inverse of a variable and is indicated
by a bar over the variable (overbar). For example, using variable A, the complement is A.
(b) Dene a literal - A literal is a variable or the complement of a variable.
(c) Identify and evaluate a sum term - a sum term is a sum of literals such as A + B + C or
B + C . There is no limit as to how many literals are in a sum term.
(d) Identify and evaluate a product term - a product term is like ABC or ABD. There is no
limit as to how many literals are in a product term.
(e) Explain Boolean addition and multiplication.
7.2.1 Laws and Rules of Boolean algebra
(a) Commutative Law: For variables A and B ,
A + B = B + A ⇒ commutative law for addition (7.1)
AB = BA ⇒ commutative law for multiplication (7.2)
(b) Associative Law:
A + (B + C) = (A + B) + C ⇒ associative law for addition (7.3)
A(BC) = (AB)C ⇒ associative law for multiplication (7.4)
(c) Distributive Law:
A(B + C) = AB + AC (7.5)
105
(d) The Rules are summarised below but not proved:
Figure 7.1: Rules of Boolean algebra
7.2.2 DeMorgan's Theorems
DeMorgan's theorems enable us to use NAND and NOR gates interchangeably with AND and OR
gates. In form of equations, DeMorgan's theorems for Boolean variables X and Y are as follows:
X ·Y =X +Y (7.6)
X +Y =X ·Y (7.7)
Fig. 4.3 is an informal proof of Eqns 4.6 and 4.7 with X = A and Y = B . Note the columns that
Figure 7.2: Rules of Boolean algebra
are equivalent shown bu arrows.
Figure 7.3: Rules of Boolean algebra
106
Example applying DeMorgan's theorem
Consider a seemingly complicated logic expression like
A + BC + D(E + F ) (7.8)
This expression can be simplied (possibly) as follows:
(1) Identify the terms to which you can apply DeMorgan's theorems, for example let
X = A + BC
Y = D(E + F )
(2) Since X + Y = X · Y , we may now write Eqn.4.8 using Eqn. 4.7 as
A + BC + D(E + F ) = X + Y = X · Y = A + BC · D(E + F )
(3) Use Rule 9 in Fig. 4.1 to cancel the double bars:
A + BC · D(E + F ) = (A + BC) · (D(E + F ))
(4) Apply DeMorgan's theorem to the second term:
(A + BC) · (D(E + F )) = (A + BC) · (D + (E + F ))
(5) Use Rule 9 to cancel double bars over E + F .
(A + BC) · (D(E + F )) = (A + BC) · (D + E + F ) (7.9)
Eqn. 4.9 is a much better-looking expression than Eqn.4.8 above but is equivalent.
More application examples
107
7.2.3 Boolean simplication of Logic expressions
108
Fig. 4.4 shows that the simplication process in the above example has signicantly reduced the
number of logic gates required to implement the expression. Fig 4.4(a) shows that for the same
function ve gates are required to implement the expression in its original form: however, only
two gates are needed for the simplied expression, shown in Fig.4.4(b).
Figure 7.4: Equivalence of Logic Circuits
7.2.4 Standard Forms of Boolean expressions
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 evalua-
tion, simplication,and implementation of Boolean expressions much more systematic and easier.
The two forms are Sum-Of-Products (SOP) and Product-Of-Sums (POS)
Sum-Of-Products (SOP)
The sum of product terms forms a SOP expression. Examples are
AB + BC + DF
ABC + CDE + BD
AB + ABC + D
Domain of Boolean expression
The domain of a Boolean expression is the set of variables contained in the expression in either
complemented or un-complemented form. For example, the domain of the expression (A + B) ·
(A + B + C) · (D + F ) is A, B, C, D, F . B is accounted for by B . Another example: the domain
of the expression AB + ABC is the set of variables A, B, C .
109
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) is neither SOP nor POS but can be converted to SOP form
by applying the distributive law:
A(B + CD) = AB + ACD (7.10)
which is a SOP expression.
Standard SOP Expressions
So far we have seen SOP expressions in which some of the product terms do not contain all of the
variables in the domain of the expression. For example, the expression ABC + ABD + ABCD
has a domain made up of the variables A, B, C, D. However, notice that the complete set of
variables in the domain is not represented in the rst two terms of the expression - D or D is
missing from the rst term and C or C does not appear in the second term. A Standard SOP
expression must contain all the variables in the domain in each product term either
in complemented form or un-complemented form. To convert an expression to standard
SOP form
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.
2. Repeat Step 1 until all resulting product terms contain all variables in the domain in either
complemented or un-complemented form. In converting a product term to standard form,
the number of product terms is doubled for each missing variable.
110
Implementation of SOP Expressions
SOP expressions are implemented by a series of AND gates feeding into an OR gate as shown in
Fig. 4.5:
Figure 7.5: Implementation of SOP expression
111
Product-Of-Sums (POS)
The product of sum terms forms a POS expression. Examples are
(A + B) · (A + B + C) · (D + F )
(A + B + C) · (C + D + E) · (B + D)
Implementation of POS Expressions
POS expressions are implemented by a series of OR gates feeding into an AND gate as shown in
Fig. 4.6:
Figure 7.6: Implementation of POS expression
Conversion of a General Expression to POS Form
Each sum term in a POS 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 POS expression is converted into standard form using
Boolean algebra Rule 8 Fig. 4.1 - i.e. a variable multiplied by its complement equals 0.
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.
2. Apply Rule 12 from Fig 4.1: A + BC = (A + B)(A + C)
3. Repeat Step I until all resulting sum terms contain all variables in the domain in either
complemented or un-complemented form.
112
7.2.5 Converting from SOP to 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. Therefore, to convert from standard
SOP to standard POS, the following steps are taken:
1. Evaluate each product term in the SOP expression. That is. determine the binary numbers
that represent the product terms.
2. Determine all of the binary numbers not included in the evaluation in Step 1.
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.
113
7.2.6 From SOP Expression to Truth Table
A truth table is simply a list of the possible combinations of input variable values and the cor-
responding output values (1 or 0). An expression with two variables requires a truth table of 4
entries. For n variables, a truth table must have 2n entries. The expression ABC + ABC + ABC
has 3 variables A, B, C and requires a truth table with 23 = 8 entries. Fig.4.7 shows such a truth
table. The entries in columns A,B and C are exhaustive - they are all and the only possible entries.
The product terms for these HIGH outputs is derived from the columns A,B and C. For example,
the entry 010 is the same as product ABC . The important product terms are those where X =1.
Figure 7.7: Truth table from SOP Expression
7.2.7 From POS Expression to Truth Table
The method is similar to that for a SOP expression with two exceptions - the product terms are
replaced by sum terms and the important terms are those where X =0.
Figure 7.8: Truth table from POS Expression
7.3 The Karnaugh Map
Karnaugh map (hereafter referred to as K-map) provides a systematic method for simplifying
Boolean expressions and, if properly used, will produce the simplest SOP or POS expression
114
possible, known as the minimum expression. However it becomes awfully dicult to apply for
more than 4 variables. Fig. 4.9(a) shows a 2-variable K-map. Each square in the map represents
a possible product term. For 2 variables, there are 4 possible product terms, 8 for 3 variables, 16
for 4 variables and so on. In general for n variables, 2n product terms are available. Each product
term must be represented on the K-map. The order of entry of the products is important being
ĀA or B B̄ , or ĀB̄, ĀB, AB, AB̄ . The variables are represented on the two axes. Examples of
product term entries in the table are shown in Fig. 4.9.
Figure 7.9: Truth table from POS Expression
7.3.1 Populating the Karnaugh Map for SOP Minimisation
This subsection answers the question of how we transfer data from a truth table into a K-map.
Suppose that we have a truth table of 3 variables and the product terms that equate to a 1 are
ĀB̄ C̄, ĀB̄C AB C̄ and AB̄ C̄ . That implies a sum-of-products expression X = ĀB̄ C̄ + ĀB̄C +
AB C̄ + AB̄ C̄ which we need to map. We enter a 1 in each square of the K-map corresponding to
the product terms that result in an output of 1 as shown in Fig. 4.10. Although this is not strictly
necessary, we then insert 0's in every unoccupied square. Figs. 4.11(a) to 4.11(d) show 3-variable
Figure 7.10: Truth table from POS Expression
and 4-variable K-maps with product terms lled in. These product terms will have come from
truth tables where the outputs are 1's and lled into appropriate truth tables according to the
method suggested by Fig. 4.10.
7.3.2 Mapping directly from a truth Table
Mapping a truth table directly into a K-map is possible as shown in Fig. 4.12.
115
Figure 7.11: Truth table from POS Expression
Figure 7.12: Truth table from POS Expression
7.3.3 Forming groups in a K-map
In Figs. 4.14(a) to 4.14(d), groups of 1's (from Figs. 4.11(a) to 4.11(d)) have been encircled. This
grouping works according to some specic rules:
(1) Each group must contain a number of 1's that is a power of 2 i.e. 2n where n = 0, 1, 2, · · · .
(2) The 1's must be adjacent either vertically or horizontally, i.e. they belong to a row or a
column. Referring to Fig. 4.13,
(a) squares in a row are adjacent, for example B and C or C and D,
(b) squares in a column are adjacent e.g. L and M or R and F ,
(c) squares linked diagonally are not adjacent e.g. R and Q or A and N or D and E .
(d) Rolling/wrapping the map vertically produces new adjacencies. For example, rolling
around vertical axis makes squares J and L adjacent. In fact it makes the left-most
column (squares A down to E ) and right-most column (squares D down to H ) adjacent.
(e) Rolling/wrapping the map horizontally produces new adjacencies as well. For example,
rolling around horizontal axis makes squares J and L adjacent. In fact it makes the
top-most row (squares A right to D) and bottom-most row (squares E right to H )
adjacent.
(f) Lastly on adjacency, two squares in a K-map are adjacent if there is only one variable
change between the two. For example, squares ABC and AB C̄ are adjacent because
only variable C changes between them. However, squares AB̄C and AB C̄ are not as
there two variable changes (B and C ) between them.
(3) In this process of forming groups, a lone 1 forms a group called a single, 2 adjacent ones
form a pair, 4 adjacent 1's form a quad and 8 adjacent 1's form an octet.
116
Figure 7.13:
(4) A group that contains other groups negates the smaller groups - for example, if one forms
an octet (8× 1's), all singles, pairs and quads in that octet disappear.
Figure 7.14: Truth table from POS Expression
In Fig. 4.14(a), we have 3 groups - one single and two pairs - note that a 1 can belong to more
than one group - in other words - groups can overlap. In Fig. 4.14(b), the top row is adjacent to
the bottom row so the 11 in the top row and the 11 in the bottom row can form a quad - this
results from wrapping or rolling the map as explained above.
7.3.4 Minimising K-map groups
Once groups have been formed as in Fig. 4.14, an expression representing each group must be
obtained. We consider the groups formed from Fig. 4.11(a) - which appears in Fig. 4.14(a). There
are 3 groups here - 1 single and 2 pairs. The single 1 encircled belongs to the intersection of the
row marked 00 and the column marked 0. Since the row is under AB , the row 00 is equivalent
to product term ĀB̄ . Similarly the column 0 under C represents C̄ . Therefore the single 1 at the
intersection is represented by the product term ĀB̄ C̄ . Consider the pair in row 11 - this pair also
belongs to the C and C̄ columns. In this group, C has changed to C̄ and drops out, leaving AB
to represent the group. The other pair belongs to column 1 which means C and rows 01 and 11
which means ĀB and AB . Thus in this pair, A has changed to Ā and is thus eliminated. The
pair is represented by BC . The logic expression for the whole map is therefore
ĀB̄ C̄ + AB + BC (7.11)
117
Figure 7.15: Truth table from POS Expression
Rolling the map can be seen in Fig. 4.14(b). The top row of 1's and the bottom row of 1's form a
quad if we roll the map horizontally. The top two 1's below to the product term ĀB̄(C + C̄) and
the bottom row 1's belong to product term AB̄(C + C̄). Within this quad, using the two product
terms, A and C have changed so they drop out. B̄ has not changed. So the quad is represented
by B̄ .
It is noted that forming a single does not eliminate any variables, forming a pair eliminates
one variable and forming a quad eliminates 2 variables while an octet eliminates 3 variables. The
number of variables eliminated by a group depends upon the size of the group. If m is the group
size, the number of variables eliminated n = log2 − log2 2 = n = log2 m. For an octet, m = 8 so
that n = log2 8 = 3 as mentioned above.
An Example
118
7.3.5 Don't Care Conditions
Sometimes a situation arises in which some input variable combinations are not allowed, for exam-
ple, in the BCD code (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 eect on the output. That is, for
these 'don't care' terms either a 1 or a 0 may be assigned to the output as it really docs not matter
since they will never occur. The 'don't care' terms can he used to advantage on the Karnaugh
map. In Fig. 4.16(a), 'Dont Cares' are marked with X s. The Y = 1 product terms from the truth
Figure 7.16: Using Don't Care Entries
table are entered into the K-map in Fig. 4.16(b) to form groups A and B . In Fig. 4.16(c) the
groups A and B are entered again together with all the 'Dont Cares'. The next step is crucial -
the largest groups are formed using the 'Dont Care' X's and adjacent pre-existing groups of 1's
i.e. gropus A and B . Thus an octet group D is formed using 'Dont Care' X's and group B and
a pair group C is formed using group A and a 'Dont Care' X. Once this has been done, all the
X's within groups C and D may be treated as 1's and enclosed groups A and B ignored as in
Fig. 4.16(d). Minimisation then continues as before, producing a more compact logic expression
Y = A + BCD as compared to Y = AB̄ C̄ + ĀBCD.
119
7.3.6 Concluding Remarks
The Karnaugh map method for logic minimisation works very well for quick logic minimisation
for a limited number of variables. The method becomes unwieldy for four or more variables. The
Boolean approach is much easier to apply in those cases.
120