Canonical form (Boolean algebra)
From Wikipedia, the free encyclopedia
This article may be too technical for most readers to understand, and needs attention from an expert on its subject. Please expand it to make it accessible to non-experts, without removing the technical details. |
In Boolean algebra, any Boolean function can be expressed in a canonical form using the dual concepts of minterms and maxterms. All logical functions are expressible in canonical form, both as a "sum of minterms" and as a "product of maxterms". This allows for greater analysis into the simplification of these functions, which is of great importance in the minimization of digital circuits.
A Boolean function expressed as a disjunction (OR) of minterms is commonly known as a "sum of products" or "SoP". Thus it is a disjunctive normal form in which only minterms are allowed as summands. Its De Morgan dual is a "product of sums" or "PoS" , which is a function expressed as a conjunction (AND) of maxterms. A product of sums is a special conjunctive normal form.
Contents |
[edit] Minterms
For a boolean function of n variables , a product term in which each of the n variables appears once (either complemented, or uncomplemented) is called a minterm. Thus, a minterm is a logical expression of n variables consisting of only the logical conjunction operator and the complement operator.
For example, abc, ab'c and abc' are examples of minterms for a boolean function of the three variables a, b and c. Note that that the ' character denotes negation, so b' is not-b, and ab'c is read as a AND NOT-b AND c.
There are 2n minterms of n variables - this is true since a variable in the minterm expression can either be in the form of itself or its complement - two choices per n variables.
[edit] Indexing minterms
In general, one assigns each minterm (ensuring the variables are written in the same order, usually alphabetic), an index based on the binary value of the minterm. A complemented term, like a' is considered a binary 0 and a noncomplemented term like a is considered a binary 1. For example, one would associate the number 6 with a b c'(1102), and write the minterm expression as m6. So m0 of three variables is a'b'c'(0002) and m7 would be a b c(1112).
[edit] Functional equivalence
It is apparent that minterm n gives a true value for the n+1 th unique function input for that logical function. For example, minterm 5, a b' c, is true only when a and c both are true and b is false - the input where a = 1, b = 0, c = 1 results in 1.
If one is given a truth table 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, qv. For example, if given the truth table
a b f(a, b) 0 0 1 0 1 0 1 0 1 1 1 0
observing that the rows that have an output of 1 are the first and third, so we can write f as a sum of minterms m0 and m2.
If we wish to verify this:
- f(a,b) = m0 + m2 = (a'b')+(ab')
then the truth table for this function, by direct computation, will be the same.
[edit] Maxterms
A maxterm is a logical expression of n variables consisting of only the logical disjunction operator and the complement operator. Maxterms are a dual of the minterm idea. Instead of using ANDs and complements, we use ORs and complements, and proceed similarly.
For example, the following are maxterms:
- a+b'+c
- a'+b+c
There are again 2n maxterms of n variables - this is true since a variable in the maxterm expression can also be in the form of itself or its complement - two choices per n variables.
[edit] Dualization
The complement of a minterm is the respective maxterm. This can be easily verified by using de Morgan's law. For example
- m1' = M1
- (a'b)' = a+b'
[edit] Indexing maxterms
Indexing maxterms is done in the opposite way as with minterms. One assigns each maxterm an index based on the order of its complements (again, ensuring the variables are written in the same order, usually alphabetic). For example, one might assign M6 (Maxterm 6) to the maxterm a'+b'+c. Similarly M0 of these three variables could be a+b+c and M7 could be a'+b'+c'.
[edit] Functional equivalence
It is apparent that maxterm n now gives a false value for the n+1 th unique function input for that logical function. For example, maxterm 5, a'+b+c', is false only when a and c both are true and b is false - the input where a = 1, b = 0, c = 1 results in 0.
If one is given a truth table of a logical function, it is possible to write the function as a "product of sums". This a special form of conjunctive normal form, q.v. For example, if given the truth table
a b f(a, b) 0 0 1 0 1 0 1 0 1 1 1 0
observing that the rows that have an output of 0 are the second and fourth, so we can write f as a product of maxterms M1 and M3.
If we wish to verify this:
- f(a,b) = M1 M3 = (a+b')(a'+b')
then the truth table for this function, by direct computation, will be the same.
[edit] 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 either less product terms, and/or product terms that contain less variables (=that are shorter). For example, the following 3-variable function:
a b c f(a, b, c) 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1
Has the canonical minterm representation: f = a'bc + abc But it has an equivalent simplified form: f = bc In this trivial example it is obvious that bc = a'bc + abc. 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 the similar manner, a canonical maxterm form can have a simplified PoS form.
A convenient method for finding the minimal PoS/SoP form of a function with up to four variables is using a Karnaugh map.
The minimal PoS and SoP forms are very important for finding optimal implementations of boolean functions and minimizing logic circuits.