Computer Organization I Lecture 6: Boolean Algebra /2/29 Wei Lu CS283
Overview Two Principles in Boolean Algebra () Duality Principle (2) Complement Principle Standard Form of Logic Expression () Sum of Minterm (2) Product of Maxterm /2/29 Wei Lu CS283 2
Objectives Know how to obtain the dual of a logic expression Know how to obtain the complement of a logic expression Understand the Minterm and Maxterm Know how to write a logic expression using Minterm Know how to write a logic expression using Maxterm /2/29 Wei Lu CS283 3
Two Principles in Boolean Algebra - Duality Principle The dual of a logical expression is obtained by interchanging + (OR) and (AND) and and. The identity is self-dual if the dual expression is equal to the original expression Example: F = (A + C) B + dual F = (A C + B) = A C + B Example: G = X Y + (W + Z) dual G = (X + Y) (W Z) = (X + Y) (W + Z) Example: H = A B + A C + B C dual H = (A + B) (A + C) (B + C) = (A + B C) (B + C) = A B + A C + B C Are any of these functions self-dual? /2/29 Wei Lu CS283 4
Two Principles in Boolean Algebra - Duality Principle Duality Principle states that the Boolean equation remains valid if we take the dual of the expression on both sides of the equal sign Example: A + = A, according to duality principle, we have A = A, one of the basic rules of Boolean algebra Example: X + X Y = X + Y, using duality principle, we have X (X + Y) = X Y /2/29 Wei Lu CS283 5
Two Principles in Boolean Algebra - Complement Principle The complement of a function F represented by F, which is obtained from interchanging AND and OR operators, and complement each constant value and literal Example: F = X Y Z + X Y Z complement F, F = (X + Y + Z) (X + Y + Z) Example: G = (A + B C) D + E complement G, G = (A (B + C) + D) E Example: H = A + B + C complement H, H = A B C = A + B + C /2/29 Wei Lu CS283 6
- What is Standard Forms? motivation of standard forms We have known one Boolean function can be represented by different Boolean expressions with a unique truth table. It is useful to specify Boolean functions in a specific form that: Allows comparison for equality, Has a correspondence to the truth table This specific form is called standard form of a logic expression standard forms usually contain: Sum of Minterms (SOM) Product of Maxterms (POM) /2/29 Wei Lu CS283 7
- What is Minterm? Minterm is a product (AND) term in which all the variables appeared exactly once, either normal or complemented form. Example: X Y Z is a product term consisting of an AND operation and 3 literals X, Y and Z Given that each binary variable may appear normal (e.g., X) or complemented (e.g., X), there are 2 n minterms for n variables. Example: Two variables (X and Y) produce 2 x 2 = 4 combinations XY (both normal) XY (X normal, Y complemented) XY (X complemented, Y normal) XY (both complemented) Thus there are four minterms of two variables. /2/29 Wei Lu CS283 8
- What is Maxterm? Maxterm is a sum (OR) term in which all the variables appeared exactly once, either normal or complemented form. Given that each binary variable may appear normal (e.g., X) or complemented (e.g., X), there are 2 n maxterms for n variables. Example: Two variables (X and Y) produce 2 x 2 = 4 combinations X + Y (both normal) X + Y (X normal, Y complemented) X + Y (X complemented, Y normal) X + Y (both complemented) Thus there are four maxterms of two variables. /2/29 Wei Lu CS283 9
- Standard Order of Minterm and Maxterm All variables will be presented in a minterm or maxterm and will be list in the same order (usually alphabetically) Example: For variables a, b, c: Maxterms: (a + b + c), (a + b + c) Terms: (b + a + c), a c b, and (c + b + a) are NOT in standard order. Minterms: a b c, a b c, a b c Terms: (a + c), b c, and (a + b) do not contain all variables /2/29 Wei Lu CS283
- Index of Minterm and Maxterm Minterms and maxterms are designated with a subscript The subscript is an index number, corresponding to a binary pattern, is used to represent the complemented or normal state of each variable list in a standard order. For Minterms: means the variable is Normal or Not Complemented means the variable is Complemented. For Maxterms: means the variable is Normal/Not Complemented means the variable is Complemented. /2/29 Wei Lu CS283
- Index Example in Three Variables Example: (for three variables) Assume the variables are called X, Y, and Z. The standard order is X, then Y, then Z. The Index (base ) = (base 2) for three variables. All three variables are complemented for minterm (X,Y,Z) and no variables are complemented for Maxterm (X,Y,Z). Minterm, called m is X,Y,Z Maxterm, called M is (X + Y + Z) Minterm 6? called m 6 is X,Y,Z Maxterm 6? called M 6 is (X + Y + Z) /2/29 Wei Lu CS283 2
- Index Example in Four Variables Index Binary Minterm Maxterm i Pattern m i M i D A+B+C+D D? 3? A+B+C+D 5 D A+B+C+D 7? A+B+C+D D A+B+C+D 3 D? 5 D A+B+C+D /2/29 Wei Lu CS283 3
- Relationship of Minterm and Maxterm Review: DeMorgan's Theorem X Y = X + Y and X + Y = X Y Two-variable example: M 2 = X + Y and m 2 = X Y Thus M 2 is the complement of m 2 and vice-versa. Since DeMorgan's Theorem holds for n variables, the above holds for terms of n variables i.e. giving: M i = m i and m i = M i Thus M i is the complement of m i. /2/29 Wei Lu CS283 4
- Minterm, Maxterm and Truth Table A B m AB m AB m 2 AB m 3 AB M A + B M A + B M 2 A + B M 3 A + B Each column in the maxterm function is the complement of the column in the minterm function since M i is the complement of m i. /2/29 Wei Lu CS283 5
- Why call Minterm and Maxterm? A B m AB m AB m 2 AB m 3 AB M A + B M A + B M 2 A + B M 3 A + B In the table: Each minterm has one and only one present in the 2 n terms (i.e. has a minimum number of ). All other entries are. Each maxterm has one and only one present in the 2 n terms All other entries are (has a maximum number of ). /2/29 Wei Lu CS283 6
We can implement any function by "ORing" the minterms corresponding to "" entries in the truth table. These are called the Sum Of Minterms (SOM) function. We can implement any function by "ANDing" the maxterms corresponding to "" entries in the truth table. These are called the Product Of Maxterms (POM) function. This gives us two standard forms: Sum of Minterms (SOM) Product of Maxterms (POM) for stating any Boolean function. /2/29 Wei Lu CS283 7
- SOM Example A B C m m m 2 m 3 m 4 m 5 m 6 m 7 F? In order to make F equal to, F is equal to m OR m 2 or m 5 OR m 7, thus "ORing" the minterms corresponding to " we have the SOM of F = m + m 2 + m 5 + m 7 = + + + /2/29 Wei Lu CS283 8
- POM Example A B C M A+B+C M A+B+C M 2 A+B+C M 3 A+B+C M 4 A+B+C M 5 A+B+C M 6 A+B+C M 7 A+B+C F? In order to make sure F equal to, F is equal to M AND M 3 AND M 4 AND M 6, thus ANDing" the maxterms corresponding to we have the POM of F = M M 3 M 4 M 6 = (A+B+C) (A+B+C) (A+B+C) (A+B+C) /2/29 Wei Lu CS283 9
- Conversion from SOM to POM A B C m m m 2 F (A,B,C) = m + m 3 + m 4 sum of minterms m 3 m 4 m 5 m 6 m 7 + m 6 = Ʃm (,3,4,6), Ʃ is the logical F F F (A,B,C) = F (A,B,C) = m + m 3 + m 4 + m 6 = m m 3 m 4 m 6 = M M 3 M 4 M 6 = M(,3,4,6) /2/29 Wei Lu CS283 2
- SOM Examples Example: Implement F in Minterms: F (A,B,C) = m + m 4 + m 7 F (A,B,C,D,E) = m 2 + m 9 + m 7 + m 23 /2/29 Wei Lu CS283 2
- POM Examples Example: Implement F in Maxterms: F (A,B,C) = M M 2 M 3 M 5 M 6 F (A,B,C,D) = M 3 M 8 M M 4 /2/29 Wei Lu CS283 22
Summary Duality and Complement Principles Two Standard Forms of Logic Expressions () Sum of Minterm (2) Product of Maxterm /2/29 Wei Lu CS283 23
Thank you Q & A /2/29 Wei Lu CS283 24