Pages 26-28 From DigitalLogicForComputing
Pages 26-28 From DigitalLogicForComputing
Normal Forms
Being mathematical objects, there are a lot of ways to represent logic functions. To
begin, we’re going to focus on two important forms of functions. These are called
normal forms or canonical forms.
The first, and the most intuitive, is called the Sum of Products (SOP) form
(mathematicians call it the Disjunctive Normal Form . . . we’ll stick with the
engineers on this one.) We get this form by looking at the 1’s in the truth table.
We say to ourselves, “Self, my prime detector function F evaluates to a 1 when the
input is 010 or 011 or 101 or 111.” We can write the math as
Now we just need to fill in the correct variables for the inputs. We see the input is
010 when x2 is 0 and x1 is 1 and x0 is 0. Remembering how to use and, or, and not
from the previous section, we understand that the input is 010 when the expression
x2 x1 x0 is 1. Filling in all four terms in this manner gives us the Sum of Products
canonical form of our function:
F ¼ x2 x1 x0 þ x2 x1 x0 þ x2 x1 x0 þ x2 x1 x0
It is called the Sum of Products form because the terms are products connected
by addition. The other canonical form is found by focusing on the 0’s in the truth
table and is the opposite of the SOP form. It’s the Product of Sums (POS) form.
The logic for this form is a bit more trying than that for the SOP form. We have
to think that “the function F is 1 when the input is not 000 and the input is not
001 and the input is not 100 and the input is not 110.” We have to use the and
connective here because otherwise we’d have a situation where we’re claiming F
can be 1 as long as the input is not, say, 000, which leaves open the possibility of
input 001 evaluating to 1, which is not what we’re after. So, for the SOP form we
have to connect the terms with ands. Now, let’s look a the terms themselves.
What does it mean to say “the input is not 110”, say? Well, the input is 110 when
x2 is 1 and x1 is 1 and x0 is 0. So if any one of these inputs is different, the input fails
to be 110. In words, this means that the input is not 110 when x2 is 0 or when x1 is
Minterms and Maxterms 27
0 or when x0 is 1. This is not the most straightforward logic ever (unless you have
studied this before and already now the august Frenchman’s law) so be sure to go
through it and make sure you have it. This is an example of a paragraph in a
technical book that may require 5–10 min of study in order to grok.
With that, we are now ready to display the Product of Sums canonical form. We
look at the rows of 0’s on the truth table, invert each variable, and OR them
together. The POS form of the prime number detector function F is given by
Again, it’s crucial you spend some time with this to be sure you have it. The SOP
form’s justification comes easily; the POS requires more effort.
These forms are important because we’ll see later that the way we write a logic
equation directly affects how much hardware is required to implement it physically
and also influences how much power the device consumes. We can see that a
function that has, say, only a few 1’s and is mostly 0’s would have a short SOP
representation but require many terms in the POS, and one that has a lot of 0’s but
few 1’s would be more easily written in the POS form. If we want to build efficient
digital systems (and we do), we need to be aware of the multiple ways we can
implement our finely crafted functions. These two canonical forms are the starting
point for logic function synthesis.
Since truth tables are large and unwieldly, we have shortcut ways to write functions
specified in our tables. We refer to the rows of 1’s as minterms and the rows of 0’s
as maxterms. Then we can express the SOP form as a sum of minterms and the
POS form as a product of maxterms. We refer to the rows by the number they
represent (given in the prime number detector table to the left) and would write our
function F as follows:
P P
Sum of Minterms: F ¼ ðm2 ; m3 ; m5 ; m7 Þ ¼ ð2; 3; 5; 7Þ
Q Q
Product of Maxterms: F ¼ ðM0 ; M1 ; M4 ; M6 Þ ¼ ð0; 1; 4; 6Þ
This is a much more compact way to express a logic function and will be used
often hereafter.
In case you were wondering (and you should be wondering) why the rows with
1’s are called minterms and the rows with 0’s maxterms when it seems it should be
the other way around, the reason is that these words refer to the number of terms
required to make the function evaluate to logic-1, not to the supposed largeness of
1 compared to 0 (remember, in Boolean Algebra we don’t have a comparison
operation and saying 1 > 0 doesn’t actually make any sense, so there is no real
reason to consider logic-1 to be “larger” than logic-0 at all.) The reason is that in the
28 3 Logic Function Synthesis
Sum of Minterms form we require a minimum number of the terms (that is, we
require just one term) to be logic-1 in order for the entire function to evaluate to
logic-1. In contrast, in the Product of Maxterms form we require a maximum
number of the terms (that is, we require all of them) to be logic-1 in order for the
entire function to evaluate to logic-1. So, there you go. Minterms and maxterms.
We can do some cute logic tricks with minterm and maxterms. Review the
following statement and make sure you understand (assuming F is a function of
three variables):
X Y X Y
If F ¼ ð1;3; 4Þ then F ¼ ¼
ð0;2;5; 6;7Þ and F ð0;2;5;6;7Þ ¼ ð1;3; 4Þ:
Don’t Cares
There is one more wrinkle that occurs when synthesizing logic functions. Right now
our prime number detector only accepts inputs in the range 0 through 7. Let’s
expand this input range to allow input of any digit 0 through 9. To accommodate
this, we are going to need to add another variable to our input so F is now a function
of four variables (when encoding numbers using variables that can take on only two
values, we can only work with up to 2n different numbers when we have n variables.
Since 23 ¼ 8 and we want ten inputs, we need to use four variables instead of three.)
So, our truth table now requires 16 rows!
Let’s examine the 16-row truth table seen in Table 3.2. We don’t actually get
more 1’s in the truth table because expanding input numbers to 9 doesn’t introduce