Simplification of Boolean Functions


You already know one method for simplifying Boolean expressions: Boolean algebra.

There are two serious limitations to using Boolean algebra though:

  • There is no algorithm you can follow that is guaranteed to lead to the simplest form of the expression
  • Given any intermediate result there is no way to tell if it is in fact the simplest form of the expression

In this lecture you will learn an algorithmic procedure for finding the simplest two level form of a Boolean expression.

This method doesn't give you the simplest form in any number of levels. However, the simplest two level form is usually what we want because as you add more levels the expression may get smaller but the propagational delay will also increase. Propagational delay determines the speed of the circuit.

Two Level Form of a Boolean Expression

The two level form of an expression refers to the number of subexpressions in the Boolean equation or the number of gates in the longest path through the gate implementation of the expression. Inverter gates don't count as a separate level.

two-levels.gif (1288 bytes)


In essence the method we are about to discuss is a pictorial way to apply the distributive law to factor out common subexpressions. For example:

F = AB + AB'
F = A(B + B')
F = A


F = ABC + ABC' + AB'C + AB'C'
F = A (BC + BC' + B'C + B'C')
F = A(1)
F = A

Intuitively, if you can find two terms that are equivalent except that one variable is the complement of the matching variable in the other term you can factor out this variable. The second example above shows that it works for multiple variable subsets--as long as they are powers of two.

The two examples above make it look easy to remove subexpressions with Boolean algebra. For small examples it is easy. For larger expressions with 3 and more variables it because much harder.

In this lecture we will study a method called Karnaugh maps you can use to quickly find the minimum standard form of a Boolean function of 4 or fewer variables. Later we will study an algorithmic method that works for functions of any number of variables. The karnaugh, or k-map, method is fast and best carried out by a human. The algorithm we will study later is tedious for humans but is easy to program using any high-level programming language.


A K-map shows the value of a function for every combination of input values just like a truth table, but a K-map spatially arranges the values so it is easy to find common terms that can be factored out. The image below shows the form of a 2,3 and 4 variable K-map.

kmaps.gif (78598 bytes)

The numbers inside of the boxes above refer to the corresponding row in the truth table for a function of the same number of variables. (You may want to use the truth table to the right to compare K-map entries and truth table entries.)

Notice how the columns are numbered on the 3 variable K-map and how both the rows and columns are numbered on the 4 variable K-map (00 01 11 10). This numbering guarantees that adjacent terms differ by only one term. For example, in the 3 variable K-map above the square with a 2 in it represents the minterm A'BC' and the square with a 6 in it represents the minterm ABC'. If both of these terms appear as minterms in an expression we could factor out the A:

A'BC' + ABC' = (A' + A)BC' = BC'


Also notice that entries at the ends of the K-map differ by only one element with entries on the other side of the K-map. For example,

A'B'C' & AB'C'

Row A B C Minterm F
0 0 0 0 A' B' C' 0
1 0 0 1 A' B' C 0
2 0 1 0 A' B C' 1
3 0 1 1 A' B C 0
4 1 0 0 A B' C' 1
5 1 0 1 A B' C 1
6 1 1 0 A B C' 1
7 1 1 1 A B C 1

We start with a general example of how to use a K-map to simplify a function and then describe a more precise procedure.

Example 1. Use a K-map to simplify the following Boolean function:

F(A,B,C) = sum.gif (83 bytes)m(2,4,5,6,7)

Since this is a function of 3 variables we first draw the outline for a 3-variable K-map. Since the function is given in terms of minterms we write the minterm number inside the box that represents that minterm. Next we put a 1 in each square where the function has the value 1. Finally, we circle groups of 1's so that all 1's are circled. We circle only groups that are powers of 2 and try to create circles as large as possible.

kmap-ex1.gif (18881 bytes)

F(A,B,C) = A + BC'

The example above gives the general idea. What follows is a more formal description of how to proceed.

implicants.gif (23905 bytes)The first step to understanding the formal procedure is understanding some terms.

Implicant - a single minterm or group of minterms that can be combined together on the K-map. For example the implicants in the example on the right are A'B'C', A'BC', A'BC, ABC, A'C', A'B, and BC.

Prime Implicant - Implicant that can not be combined with another one to remove a literal. For example: A'C', A'B, BC.

Each product term in the minimum sum of products expression is a prime implicant.

Essential Prime Implicant - A prime imlpicant that includes a minterm not covered by any other prime implicant. For example: A'C' and BC.

Note, that with the example above if you're not careful you could end up with an expression with too many prime implicants. For example, if you choose A'B first you would then have to choose A'C' and BC to cover every implicant in the on-set. This observation is the motivation for the formal K-map procedure that follows.

To derive the minimized expression from a K-map:

1. Draw the K-map and put a 1 in each square that corresponds to a minterm of the function. You can draw the K-map from a truth table, Boolean expression, etc.

2. Find the prime implicants. To do this find the largest adjacent groups of 1's. Groups must be "square" and the number of 1's in a group must be a power of 2.

3. Find the essential prime implicants. An essential prime implicant is a prime implicant that includes a 1 not covered by any other prime implicants.

4. Write down the minimized expression. First write down all essential prime implicants. If there are any 1's not covered by prime implicants, carefully select prime implicants to cover the remaining 1's. Note, you may have to try several selections to find the minimal form of the expression.

Example 2. Use a K-map to simplify the following Boolean function:

F(A,B,C,D) =product.gif (95 bytes)M(0,1,2,4,9,11,15)

F(A,B,C,D) = sum.gif (83 bytes)m(3,5,6,7,8,10,12,13,14)

kmap-ex2a.gif (36091 bytes)   kmap-ex2b.gif (17797 bytes)

F(A,B,C,D) =  BC'D + AD' + A'CD + BCD'

Don't Cares

Sometimes the output of a function for a specific input value is "don't care". For example, the output of a BCD increment by one circuit given the input 1010 would be XXXX, or don't care because the input (1010)2 = (10)10 would never be seen. Don't cares act like joker in a deck of playing cards--we can make them whatever we want. When you are simplifying a function using a K-map these don't care values help you to form larger groups of 1's which give you smaller prime implicants.

Example 3. Use a K-map to simplify the following Boolean function:

F(A,B,C,D) = sum.gif (83 bytes)m(0,4,5,8,10,15) + d(2,7,9,13)

kmap-ex3a.gif (28029 bytes)  kmap-ex3b.gif (22132 bytes)

F(A,B,C,D) =  C'A'B +DB + D'B'