Examples: If f 5 = AB + AB then f 5 = A B + A B = f 10 If f = ABC + ABC + A B C then f = AB C + A BC + AB C + A BC + A B C In terms of a truth table, if f is the sum (OR) of all the minterms with a 1 in the f column, then f is the sum (OR) of all the minterms with a 0 in the f column. Practice Problems - Facts 1. How many minterms exist for a Boolean space of 5 variables? 2. How many possible Boolean functions of 4 variables are there? 3. List all minterms for a Boolean space of 1 variable. 4. List all functions for a boolean space of 1 variable 5. If f = A B, what is the DNF for f? Algebraic Rules of Determining the equivalence of two Boolean expressions can be done algebraically as well as by using truth tables, assuming that we know the rules, postulates and theorems, of. In addition we can use such rules to simplify Boolean expressions, and to take arbitrary Boolean expressions and put them in canonical form (for comparison, or truth table generation.) Let s start with some axioms, or postulates (fundamental properties) of. Postulates 1. Both AND and OR have identity elements A + 0 = A A1 = A 2. Commutativity A+B = B+A AB = BA NTC 2/26/05 71
3. Associativity A+(B+C) = (A+B)+C A(BC) = (AB)C 4. Distributivity A+BC = (A+B)(A+C) A(B+C) = AB + AC 5. Every element has a complement 0'= 1 1'= 0 A+A =1 A A = 0 and (A ) = A Note that each of these postulates contains a pair of rules; they are called duals of each other. In general, the dual of any Boolean expression is obtained by replacing all + s with s and all 0's with 1's (and vice versa). If a Boolean expression or equation is determined to be true, then its dual will also be true, and it is not necessary to prove the dual independently. This property of is called the Principal of Duality. By the way, it would seem that the functions AND and OR correspond in many ways with the arithmetic operators MULTIPLICATION and ADDITION, respectively. This is certainly true regarding identities, commutativity, and associativity. Note, however, that the distributive rule is a bit different in that both Boolean operators are distributive across each other, while multiplication is distributive across addition, but not vice versa. Many additional theorems of can be proved using the postulates given above. Theorems, of course, can then be used to prove other theorems and results. The most important and useful theorems are presented here, with their proofs. In each case, as a result of the Principle of Duality, only one of the dual pair need be proved. Theorems 1. Idempotency A+A = A AA = A Proof: A+A = (A+A)1 Identity = (A+A)(A+A ) Complement = A+AA Distributivity NTC 2/26/05 72
= A+0 Complement = A Identity 2. A+1 = 1 A0 = 0 Proof: A+1 = A + (A+A ) Complement = (A+A)+A Associativity = A+A Idempotency (just proved above) = 1 Complement 3. Absorption A+AB = A A(A+B) = A Proof: A+AB = A1 + AB Identity = A(1+B) Distributivity = A1 Theorem 2 (above) = A Identity 4. Adsorption A+A B = A+B A(A +B) = AB Proof: A+A B = (A+A )(A+B) Distributivity = 1(A+B) Complement = A+B Identity 5. De Morgan s Theorem (A+B) = A B (AB) = A +B Proof: (By contradiction) Assume (A+B) A B. Then (A+B) (A+B) A B (A+B) AND (A+B) to both sides 0 A B A+A B B Distributivity 0 0B + A 0 Complement/Associativity 0 0 Contradiction The primary use we will make of these theorems is for the simplification of Boolean expressions, generating canonical forms, and for proving the equivalence of Boolean expressions. NTC 2/26/05 73
Simplification and Equivalence a) Simplify AB+AB C = A(B+B C) Distributivity = A(B+C) Adsorption = AB+AC Distributivity b) Prove ABC+ ABC +AB C is equivalent to AB + AC ABC+ABC +AB C = AB(C+C ) +AB C Distributivity = AB+AB C Complement = AB+AC (proved in a) Let s go back to expression [B1], and simplify it: AB + C(A+BC) + BC [B1] =AB +C(A (B +C )) + BC De Morgan s Theorem =AB +CA B + CA C + BC Distributivity =(A+CA )B + CA C + BC Distributivity =(A+C)B + CA C + BC Adsorption =(A+C)B + A CC + BC Commutativity =(A+C)B + A 0 + BC Complement =AB + CB + 0 + BC Distributivity & theorem 2 =AB + CB + C B Idempotency and Associativity =AB + B C + BC Commutativity [B4] This (as will be shown using a different technique later) is the simplest form of this particular Boolean expression. Note that this is a sum of products form, but is not DNF since not all terms contain all variables (in fact, none do.) NTC 2/26/05 74
Practice Problems - Algebraic Simplification 1. Write the duals of the following Boolean equations a. A + B = 1 b. A(B +C ) = 0 c. A B + B C = 1 d. (A + B )CD = 0 2. Simplify Algebraically the following Boolean expressions a. f 1 = A + A B b. f 2 = A(A+B ) c. f 3 = A + ABC +A C d. f 4 = AB + AB + A B + A B e. f 5 = A(B + C)A f. f 6 = (A + B)(A + B ) g. f 7 = (A B + C) + C Canonical Forms The canonical Boolean forms are the Disjunctive Normal Form, referenced repeatedly above, and the Conjunctive Normal form (CNF). Recall that the DNF is a sum-ofproducts form in which every minterm contains every variable used in the function; the CNF is a product-of-sums form in which every maxterm contains every variable used in the function. Suppose we are given a Boolean function f = AB + B C in sum of products form; how do we generate the DNF form? One way is to produce the truth table for the function and simply write out the sum of the terms from each row containing a 1 in the result (f) column. We have already done this. Another way is to use the postulates and theorems as follows: 1. Take each term y, and, using each missing variable x, AND the expression (x+x ) to that term. This is clearly allowed since x+x = 1 and y1 = y. In the current example f = AB(C+C ) + (A+A )B C 2. Expand the expression using the distributive rule to get the DNF form NTC 2/26/05 75
f = ABC + ABC + AB C + A B C [B5] 3. Eliminate any duplicate terms (which can sometimes happen) since y + y = y. Remember that equivalency of two Boolean expressions can be shown if their truth tables are identical. This is another way of saying their canonical forms are identical, or that they can both be simplified to the same sum of products or product of sums expression. What about the Conjunctive Normal Form? How is this derived? The easiest way is to find the DNF of f and then apply De Morgan s Theorem. How do we get the DNF of f? In one of two ways. Go to the truth table for f and write down the terms for all the rows in which f = 0 (instead of the terms from rows where f=1.) This is the DNF for f Alternatively, remember that the canonical forms contain terms which contain all the variables. There are a total of 2 n such terms possible. If you know the DNF of f, then the DNF of f is simply the sum of all the terms which don t appear in f. For example, using either method, the f for the f in [B5] is f = A B C + A BC + AB C + A BC [B6] Now, by De Morgan s Theorem f = (A B C + A BC + AB C + A BC) = (A+B+C)(A+B +C)(A +B+C)(A+B +C ) [B7] [B7] is the CNF form of [B5] as well as the original f = AB + B C A note on an alternate notation: As we can see from the above examples, Boolean expressions in DNF or CNF can be quite lengthy and hard to read. This is especially true here, where we have chosen to use an apostrophe to represent the complement, or not, function as the apostrophe is hard to see in certain fonts. We could, if desired, represent each minterm or maxterm by the binary number it represents. This is usually done as a subscript to the letter m (for minterms) or M (for maxterms), or, alternatively, as part of a set of numbers representing the collection of minterms or maxterms. Consider the minterm AB C ; if we NTC 2/26/05 76
think of this as the binary bit string 100'(a one for an uncomplemented variable and a 0 for a complemented variable) then this minterm has the value 4. The minterm is then specified as m 4. Then [B6] could be rewritten as f = m 0 + m 2 + m 4 + m 3 It could be specified even more compactly as f = m(0, 2, 3, 4) Similarly, [B7] could be represented (using capital M s for maxterms) as f = M 7 M 5 M 3 M 4 or f = M(3, 4, 5, 7) Using this nomenclature, doing the last example is much easier. The original f is given by [B5] f = m(7, 6, 5, 1) By simply examining the numbers and recognizing that the complement of f consists of all the minterms unused by f we can see that f = m(0, 2, 3, 4) We can apply DeMorgan s theorem to this quite neatly by simply subtracting each number from 7 5. Applying DeMorgan s theorem we get (where the numbers are now maxterms, not minterms) f = M(7, 5, 4, 3) Which is the same as [B7]. 5 In general, for n variables, subtract from 2 n - 1. For functions of two variables, for instance, there are only four possible minterms, 0, 1, 2, 3 and to take the complement of any minterm simply subtract its number from 3 (= 2 2-1) NTC 2/26/05 77
Practice Problems - Canonical Forms 1. Find the Disjunctive Normal Form for the following Boolean expressions, assuming the DNF has the number of variables given. a. f a = A + B (assume two variables, A and B) b. f b = A + B (assume three variables, A, B, and C) c. f c = AB C (assume three variables, A, B, and C) d. f d = 1 (Assume three variables, A, B, and C) e. f e = AB + A C + BC (assume three variables, A, B, and C) f. f f = (A + B)(A + C) (assume three variables, A, B, and C) 2. Find the Conjunctive Normal Form for the following Boolean expressions, assuming the CNF has the number of variables given. a. g a = A + B (assume two variables, A and B) b. g b = A + B (assume three variables, A, B, and C) c. g c = ABC + ABC + AB C + A B C (assume three variables, A, B, and C) d. g d = (A + B )(B + C ) (assume three variables, A, B, and C) e. g e = 1 (assume two variables, A, and B) Karnaugh Maps Karnaugh Maps are the preferred mechanism for the simplification of Boolean expressions. They constitute a graphical means for this purpose, but are, for practical reasons, limited to expressions with relatively few variables, usually less then or equal to four, although they can conceptually be used with as many as desired. A Karnaugh map is a chart or table of rows and columns. Each row and column is labeled with appropriate Boolean terms. The cells which constitute the intersection of rows and columns contain 1's and 0's, depending on whether the corresponding terms appear in the final function. In fact, a Karnaugh Map is nothing more than a Truth Table NTC 2/26/05 78