In
Boolean algebra
In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variables are the truth values ''true'' and ''false'', usually denoted 1 and 0, whereas ...
, any
Boolean function
In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth function ...
can be expressed in the canonical disjunctive normal form (
CDNF)
or minterm canonical form and its dual canonical conjunctive normal form (
CCNF
:''CCNF may also mean Canonical conjunctive normal form in Boolean algebra.''
G2/mitotic-specific cyclin-F is a protein that in humans is encoded by the ''CCNF'' gene.
Function
This gene encodes a member of the cyclin family. Cyclins are impo ...
) or maxterm canonical form. Other
canonical form
In mathematics and computer science, a canonical, normal, or standard form of a mathematical object is a standard way of presenting that object as a mathematical expression. Often, it is one which provides the simplest representation of an ob ...
s include the complete sum of prime implicants or
Blake canonical form (and its dual), and the
algebraic normal form
In Boolean algebra, the algebraic normal form (ANF), ring sum normal form (RSNF or RNF), ''Zhegalkin normal form'', or '' Reed–Muller expansion'' is a way of writing logical formulas in one of three subforms:
* The entire formula is purely tr ...
(also called Zhegalkin or Reed–Muller).
''Minterms'' are called products because they are the
logical AND of a set of variables, and ''maxterms'' are called sums because they are the
logical OR of a set of variables. These concepts are dual because of their complementary-symmetry relationship as expressed by
De Morgan's laws
In propositional logic and Boolean algebra, De Morgan's laws, also known as De Morgan's theorem, are a pair of transformation rules that are both valid rules of inference. They are named after Augustus De Morgan, a 19th-century British mathem ...
.
Two dual canonical forms of ''any'' Boolean function are a "sum of minterms" and a "product of maxterms." The term "Sum of Products" (SoP or SOP) is widely used for the canonical form that is a disjunction (OR) of minterms. Its
De Morgan dual is a "Product of Sums" (PoS or POS) for the canonical form that is a conjunction (AND) of maxterms. These forms can be useful for the simplification of these functions, which is of great importance in the optimization of Boolean formulas in general and
digital circuit In theoretical computer science, a circuit is a model of computation in which input values proceed through a sequence of gates, each of which computes a function. Circuits of this kind provide a generalization of Boolean circuits and a mathematica ...
s in particular.
Minterms
For a
boolean function
In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth function ...
of
variables
, a
product term in which each of the
variables appears once (either in its complemented or uncomplemented form) is called a ''minterm''. Thus, a ''minterm'' is a logical expression of ''n'' variables that employs only the ''complement'' operator and the ''conjunction'' operator.
For example,
,
and
are 3 examples of the 8 minterms for a Boolean function of the three variables
,
, and
. The customary reading of the last of these is ''a AND b AND NOT-c''.
There are 2
''n'' minterms of ''n'' variables, since a variable in the minterm expression can be in either its direct or its complemented form—two choices per variable.
Indexing minterms
Minterms are often numbered by a binary encoding of the complementation pattern of the variables, where the variables are written in a standard order, usually alphabetical. This convention assigns the value 1 to the direct form (
) and 0 to the complemented form (
); the minterm is then
. For example, minterm
is numbered 110
2 = 6
10 and denoted
.
Functional equivalence
A given minterm ''n'' gives a true value (i.e., 1) for just one combination of the input variables. For example, minterm 5, ''a'' ''b''
' ''c'', is true only when ''a'' and ''c'' both are true and ''b'' is false—the input arrangement where ''a'' = 1, ''b'' = 0, ''c'' = 1 results in 1.
Given the
truth table
A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra (logic), Boolean algebra, boolean functions, and propositional calculus—which sets out the functional values of logical expression (mathematics) ...
of a logical function, it is possible to write the function as a "sum of products". This is a special form of
disjunctive normal form
In boolean logic, a disjunctive normal form (DNF) is a canonical normal form of a logical formula consisting of a disjunction of conjunctions; it can also be described as an OR of ANDs, a sum of products, or (in philosophical logic) a ''cluster co ...
. For example, if given the truth table for the arithmetic sum bit ''u'' of one bit position's logic of an adder circuit, as a function of ''x'' and ''y'' from the addends and the carry in, ''ci'':
Observing that the rows that have an output of 1 are the 2nd, 3rd, 5th, and 8th, we can write ''u'' as a sum of minterms
and
. If we wish to verify this:
evaluated for all 8 combinations of the three variables will match the table.
Maxterms
For a
boolean function
In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth function ...
of variables
, a sum term in which each of the variables appears once (either in its complemented or uncomplemented form) is called a ''maxterm''. Thus, a ''maxterm'' is a logical expression of variables that employs only the ''complement'' operator and the ''disjunction'' operator. Maxterms are a dual of the minterm idea (i.e., exhibiting a complementary symmetry in all respects). Instead of using ANDs and complements, we use ORs and complements and proceed similarly.
For example, the following are two of the eight maxterms of three variables:
: ''a'' + ''b''′ + ''c''
: ''a''′ + ''b'' + ''c''
There are again 2
''n'' maxterms of variables, since a variable in the maxterm expression can also be in either its direct or its complemented form—two choices per variable.
Indexing maxterms
Each maxterm is assigned an index based on the opposite conventional binary encoding used for minterms. The maxterm convention assigns the value 0 to the direct form
and 1 to the complemented form
. For example, we assign the index 6 to the maxterm
(110) and denote that maxterm as ''M''
6. Similarly ''M''
0 of these three variables is
(000) and ''M''
7 is
(111).
Functional equivalence
It is apparent that maxterm ''n'' gives a ''false'' value (i.e., 0) for just one combination of the input variables. For example, maxterm 5, ''a''′ + ''b'' + ''c''′, is false only when ''a'' and ''c'' both are true and ''b'' is false—the input arrangement where a = 1, b = 0, c = 1 results in 0.
If one is given a
truth table
A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra (logic), Boolean algebra, boolean functions, and propositional calculus—which sets out the functional values of logical expression (mathematics) ...
of a logical function, it is possible to write the function as a "product of sums". This is a special form of
conjunctive normal form
In Boolean logic, a formula is in conjunctive normal form (CNF) or clausal normal form if it is a conjunction of one or more clauses, where a clause is a disjunction of literals; otherwise put, it is a product of sums or an AND of ORs. As a cano ...
. For example, if given the truth table for the carry-out bit ''co'' of one bit position's logic of an adder circuit, as a function of ''x'' and ''y'' from the addends and the carry in, ''ci'':
Observing that the rows that have an output of 0 are the 1st, 2nd, 3rd, and 5th, we can write ''co'' as a product of maxterms
and
. If we wish to verify this:
:
evaluated for all 8 combinations of the three variables will match the table.
Dualization
The complement of a minterm is the respective maxterm. This can be easily verified by using
de Morgan's law
In propositional logic and Boolean algebra, De Morgan's laws, also known as De Morgan's theorem, are a pair of transformation rules that are both valid rules of inference. They are named after Augustus De Morgan, a 19th-century British mathem ...
. For example:
Non-canonical PoS and SoP forms
It is often the case that the canonical minterm form can be simplified to an equivalent SoP form.
This simplified form would still consist of a sum of product terms. However, in the simplified form,
it is possible to have fewer product terms and/or product terms that contain fewer variables.
For example, the following 3-variable function:
has the canonical minterm representation:
, but it has an equivalent simplified form:
.
In this trivial example, it is obvious that
, but the simplified form has both fewer product terms,
and the term has fewer variables.
The most simplified SoP representation of a function is referred to as a ''minimal SoP form''.
In a similar manner, a canonical maxterm form can have a simplified PoS form.
While this example was simplified by applying normal algebraic methods
f = (a' + a) b c">math>f = (a' + a) b c in less obvious cases a convenient method for finding the minimal PoS/SoP form of a function with up to four variables is using a
Karnaugh map
The Karnaugh map (KM or K-map) is a method of simplifying Boolean algebra expressions. Maurice Karnaugh introduced it in 1953 as a refinement of Edward W. Veitch's 1952 Veitch chart, which was a rediscovery of Allan Marquand's 1881 ''logic ...
.
The minimal PoS and SoP forms are important for finding optimal implementations of boolean functions
and minimizing logic circuits.
Application example
The sample truth tables for minterms and maxterms above are sufficient to establish the canonical form for a single bit position in the addition of binary numbers, but are not sufficient to design the digital logic unless your inventory of gates includes AND and OR. Where performance is an issue (as in the Apollo Guidance Computer), the available parts are more likely to be NAND and NOR because of the complementing action inherent in transistor logic. The values are defined as voltage states, one near ground and one near the DC supply voltage V
cc, e.g. +5 VDC. If the higher voltage is defined as the 1 "true" value, a NOR gate is the simplest possible useful logical element.
Specifically, a 3-input NOR gate may consist of 3 bipolar junction transistors with their emitters all grounded, their collectors tied together and linked to V
cc through a load impedance. Each base is connected to an input signal, and the common collector point presents the output signal. Any input that is a 1 (high voltage) to its base shorts its transistor's emitter to its collector, causing current to flow through the load impedance, which brings the collector voltage (the output) very near to ground. That result is independent of the other inputs. Only when all 3 input signals are 0 (low voltage) do the emitter-collector impedances of all 3 transistors remain very high. Then very little current flows, and the voltage-divider effect with the load impedance imposes on the collector point a high voltage very near to V
cc.
The complementing property of these gate circuits may seem like a drawback when trying to implement a function in canonical form, but there is a compensating bonus: such a gate with only one input implements the complementing function, which is required frequently in digital logic.
This example assumes the Apollo parts inventory: 3-input NOR gates only, but the discussion is simplified by supposing that 4-input NOR gates are also available (in Apollo, those were compounded out of pairs of 3-input NORs).
Canonical and non-canonical consequences of NOR gates
A set of 8 NOR gates, if their inputs are all combinations of the direct and complement forms of the 3 input variables ''ci, x,'' and ''y'', always produce minterms, never maxterms—that is, of the 8 gates required to process all combinations of 3 input variables, only one has the output value 1. That's because a NOR gate, despite its name, could better be viewed (using De Morgan's law) as the AND of the complements of its input signals.
The reason this is not a problem is the duality of minterms and maxterms, i.e. each maxterm is the complement of the like-indexed minterm, and vice versa.
In the minterm example above, we wrote
but to perform this with a 4-input NOR gate we need to restate it as a product of sums (PoS), where the sums are the opposite maxterms. That is,
:
In the maxterm example above, we wrote
but to perform this with a 4-input NOR gate we need to notice the equality to the NOR of the same minterms. That is,
:
Design trade-offs considered in addition to canonical forms
One might suppose that the work of designing an adder stage is now complete, but we haven't addressed the fact that all 3 of the input variables have to appear in both their direct and complement forms. There's no difficulty about the addends ''x'' and ''y'' in this respect, because they are static throughout the addition and thus are normally held in latch circuits that routinely have both direct and complement outputs. (The simplest latch circuit made of NOR gates is a pair of gates cross-coupled to make a flip-flop: the output of each is wired as one of the inputs to the other.) There is also no need to create the complement form of the sum ''u''. However, the carry out of one bit position must be passed as the carry into the next bit position in both direct and complement forms. The most straightforward way to do this is to pass ''co'' through a 1-input NOR gate and label the output ''co''′, but that would add a gate delay in the worst possible place, slowing down the rippling of carries from right to left. An additional 4-input NOR gate building the canonical form of ''co''′ (out of the opposite minterms as ''co'') solves this problem.
:
The trade-off to maintain full speed in this way includes an unexpected cost (in addition to having to use a bigger gate). If we'd just used that 1-input gate to complement ''co'', there would have been no use for the minterm
, and the gate that generated it could have been eliminated. Nevertheless, it's still a good trade.
Now we could have implemented those functions exactly according to their SoP and PoS canonical forms, by turning NOR gates into the functions specified. A NOR gate is made into an OR gate by passing its output through a 1-input NOR gate; and it is made into an AND gate by passing each of its inputs through a 1-input NOR gate. However, this approach not only increases the number of gates used, but also doubles the number of gate delays processing the signals, cutting the processing speed in half. Consequently, whenever performance is vital, going beyond canonical forms and doing the Boolean algebra to make the unenha