Computer Organization I Lecture 7: Boolean Algebra
Overview Standard Form of Logic Expression (1) Implementing Logic Function in Sum of Minterm (2) Implementing Logic Function in Product of Maxterm Alternative Standard Form of Logic Expression (1) Sum of Product (SOP) (2) Product of Sum (POS)
Objectives Know how to implement a logic function in SOM and POM given any logic expression
Standard Forms of Logic Expression - Sum of Minterms Any Boolean function can be expressed as a Sum of Minterms. For the function table, the minterms used are the terms corresponding to the 1's For expressions, expand all terms first to explicitly list all minterms. Do this by ANDing any term missing a variable x with a term ( x + x ). Example: Implement F = X + X Y as a sum of minterms. First expand terms: F = X (Y + Y) + X Y Then distribute terms: F = X Y + X Y + X Y Express as sum of minterms: F = m 3 + m 2 + m 0
Standard Forms of Logic Expression - Another Example about Sum of Minterms Example: Implement F = A + B C There are three variables, A, B, and C which we take to be the standard order. Expanding the terms with missing variables Collect terms (i.e. removing the duplicate terms) Express as SOM F = A (B + B) (C + C) + (A + A) B C = (A B + A B ) (C + C) + A B C + A B C = (A B C + A B C + A B C + A B C) + A B C + A B C = m 7 + m 6 + m 5 + m 4 + m 1 = m 1 + m 4 + m 5 + m 6 + m 7
Standard Forms of Logic Expression - Shorthand SOM Form Start with F = A + B C and end up with F = m 1 + m 4 + m 5 + m 6 + m 7 F can be denoted in the formal shorthand: F = Ʃm (1,4,5,6,7), Ʃ is the logical sum of minterms Note that we explicitly show the standard variables in order and drop the m designators.
Standard Forms of Logic Expression - Product of Maxterms Any Boolean function can be expressed as a Product of Maxterms. For the function table, the maxterms used are the terms corresponding to the 0's For expressions, expand all terms first to explicitly list all maxterms. Do this by first applying the distributive law, ORing terms missing variable x with a term equal to x x and then applying the distributive law again. Example: Convert F (X,Y,Z) = X + X Y as a product of maxterms. First apply distributive law: F = (X + X) (X + Y) = 1 (X + Y) = X + Y Then add missing variable: F = X + Y + Z Z = (X + Y + Z) (X+Y+Z) Express as sum of maxterms: F = M 2 M 3
Standard Forms of Logic Expression - Another Example about POM Example: Convert F(A,B,C) = A C + B C + A B Apply the distributive law repeatedly Collect terms F = (A + B + C) (A + B + C) Express as POM F = M 2 M 5
Standard Forms of Logic Expression - Shorthand POM Form Start with F = A C + B C + A B and end up with F = M 2 M 5 F can be denoted in the formal shorthand: F = M(2,5), is the logical consecutive product maxterms Note that we explicitly show the standard variables in order and drop the M designators.
A B C m 0 ABC 0 1 0 1 0 1 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 1 Standard Forms of Logic Expression - Complement Function by SOM m 1 ABC m 2 ABC 1 0 0 1 m 3 ABC m 4 ABC 1 0 0 1 m 5 ABC m 6 ABC 1 0 0 1 m 7 ABC The complement of a function expressed as a sum of minterms is constructed by selecting the minterms missing in the sum-of-minterms forms. F (A,B,C) = m 0 + m 2 + m 5 + m 7 = Ʃm (0,2,5,7) F (A,B,C) = m 1 + m 3 + m 4 + m 6 = Ʃm (1,3,4,6) F 1 0 1 0 0 1 0 1 F 0 1 0 1 1 0 1 0
Standard Forms of Logic Expression - Complement Function by POM the complement of a function expressed by a Sum of Minterms form is simply the Product of Maxterms with the same indices according to DeMorgan Theorem. Example: given F (A,B,C) = Ʃm (0,2,5,7) we have F in maxterms: F (A,B,C) = M (0,2,5,7) we have F in minterms: F (A,B,C) = Ʃm (1,3,4,6) we have F in maxterms: F (A,B,C) = M (1,3,4,6)
Standard Forms of Logic Expression - Conversion between SOM and POM To convert between sum-of-minterms and product-of-maxterms form (or vice-versa) we follow these steps: Find the function complement by swapping terms in the list with terms not in the list. Change from products to sums, or vice versa. Example: Given F as: F (A,B,C) = Ʃm (1,3,5,7) Form the Complement: F (A,B,C) = Ʃm (0,2,4,6) Then use the other form with the same indices this forms the complement again, giving the other form of the original function: F (A,B,C) = M (0,2,4,6)
Alternative Standard Form of Logic Expression So far we have known that any logic function with a given truth table can be expressed as a standard form using sum of minterms or product of maxterms. This can be considered as the first step of logic circuit design. Once the standard form is obtained according to truth table, the second step is to try to simplify expression to see if the number of product or the number of literals can be reduced in order to simplify circuit. The result might be in a sum of product (SOP) form or a product of sum (POS) form, and we call the SOP and POS form as the alternative standard form of logic expression
Alternative Standard Form of Logic Expression Sum-of-Product (SOP) form: logic expressions are written as an OR of AND terms Product-of-Sums (POS) form: logic expressions are written as an AND of OR terms Examples: SOP: A B C + A B C + B POS: (A + B) (A + B + C) C These mixed forms are neither SOP nor POS (A B + C) (A + C) A B C + AC (A + B)
Summary Implementing any logic function in SOM and POM based on Truth Table or Boolean Algebraic Manipulation Introduction to SOP and POS
Thank you Q & A