Chapter 4 Boolean Algebra and Logic Simplification By
Chapter 4 Boolean Algebra and Logic Simplification By Taweesak Reungpeerakul 241 -208 CH 4 1
Contents n n n n 241 -208 CH 4 Boolean Operations & Expressions Rules of Boolean Algebra De. Morgan’s Theorems Simplification Using Boolean Algebra Standard Forms of Boolean Algebra Karnaugh Map Five-variable Karnaugh Map 2
4. 1 Boolean Operations & Expressions n 241 -208 CH 4 Boolean Addition is equivalent to the OR operation. 0+0 = 0 0+1 = 1 1+0 = 1 1+1 = 1 n Boolean multiplication is equivalent to the AND operation. 0· 0 = 0 0· 1 = 0 1· 0 = 0 1· 1 = 1 3
4. 2 Laws&Rules of Boolean Algebra Laws (CAD) Commutative, Associative, and Distributive A+B = B+A AB = BA A+ (B+C) = (A+B)+C A(BC) = (AB)C A(B+C) = AB+AC 241 -208 CH 4 (C for addition) (C for multiplication) (A for addition) (A for multiplication) (distributive) 4
4. 2 Laws&Rules of Boolean Algebra) cont(. 1) 2) 3) 4) 5) 6) 7) 8) 9) 241 -208 CH 4 A+0=A 10) A·A=A A+1=1 11) A·A=0 A· 0=0 12) A=A A· 1=1 A+A=A Rules of Boolean Algebra A+A=1 A+AB=A+B (A+B)(A+C)=A+BC 5
4. 3 De. Morgan’s Theorems n n The complement of a product of variables is equal to the sum of the complements of the variables. XY = X + Y The complement of a sum of variables is equal to the product of complements of the variables. X + Y = X ·Y 241 -208 CH 4 6
Examples of De. Morgan’s Theorems n Ex#1: (AB+C)(BC) n Ex# 2: AB + CDE = (AB+C) +(BC) = (AB) · (CDE) = (AB)C +(B+C) = (A+B) · (CD+E) = (A+B)C + B+C = (A+B) · (CD+E) Question: (A+B)C D Question: A+B+C+ DE Ans: (A ·B)+C+D Ans: A B C+D+E 241 -208 CH 4 7
4. 4 Boolean Analysis of Logic Circuits You should be able to: 241 -208 CH 4 • Determine the Boolean expression for a combination logic gates. • Evaluate the logic operation of a circuit from the Boolean expression • Construct a truth table 8
4. 4 Boolean Analysis of Logic Circuits (cont. ) A B AB AB+C C D (AB+C)D Cause 1 when D and (AB+C) = 1 If AB = 0, C = 1 If AB = 1, C = 0 or 1 AB = 1 when both A = B = 1 241 -208 CH 4 A 0 0 0 0 1 1 1 1 B 0 0 0 0 1 1 1 1 C 0 0 1 1 Truth Table D (AB+C)D 0 0 1 0 0 0 1 1 0 0 1 1 9
4. 5 Simplification using Boolean Algebra n EX#1: AB+A(B+C)+B(B+C) Use distributive law A(B+C) = AB+AC = AB+AB+AC+BB+BC Use rule #5, A+A = A then A+A = AB + AC + BC Use distributive law A(B+C) = AB+AC+B(1+C) Use rule #2 (1+A) = 1 241 -208 CH 4 10
4. 5 Simplification using Boolean Algebra (cont. ) = AB+AC+B Use commutative law A+B = B+A = AB+B+AC Use commutative law A+B = B+A, AB = BA = B+BA+AC Use distributive law A(B+C) = AB+AC = B(1+A)+AC Use rule #2 (1+A) = 1 = B+AC 241 -208 CH 4 Answer 11
4. 5 Simplification using Boolean Algebra (cont. ) Can u follow up this example by yourself ? EX#2: A B C+A B C n = B C+A B C = B C+A B C = BC+B(C+AC) Use rule #11 A+AB = A+B = BC+B(C+A) = BC+B C+AB 241 -208 CH 4 Answer How about trying more questions, for example : Some questions in pp. 179 !!!! 12
4. 6 Standard Forms of Boolean Expressions n Sum-of-Products (SOP): 2 or more product terms are summed by Boolean addition such as AB+ABC+AC Watch out ! each bar if any must denote on only a single literal (variable) (in brief watch out the NAND), for example AB+ABC+AC is not SOP Ex# 1: convert (A+B)(C+D) into SOP form apply distributive law, hence = AC+AD+BC+BD 241 -208 CH 4 13
4. 6 Standard Forms of Boolean Expressions (cont. ) Ex# 2: (A + B) + C = (A+B)C De. Morgan’s = (A+B)C Distributive = AC+BC Domain is the set of literals (or variables) contained in the Boolean expression !! 241 -208 CH 4 14
4. 6 Standard Forms of Boolean Expressions (cont. ) n Standard SOP Form: All variables in the domain appear in each product term such as ABC+ABC Convert SOP to SSOP Step 1: Consider domain of SOP Step 2: Multiply each nonstandard term by (L+L) Step 3 : Repeat step 2 until no nonstandard term left. 241 -208 CH 4 15
4. 6 Standard Forms of Boolean Expressions (cont. ) Ex# 1: AB+ABC standard SOP = AB(C+C)+ABC = ABC+ABC Ex# 2: B+ABC = B(A+A)+ABC = AB+AB+ABC = AB(C+C)+ABC = ABC+ABC+ABC 241 -208 CH 4 16
Standard Forms (cont. ) n Product-of-Sum (POS): 2 or more sum terms are multiplied such as (A+B)(A+B+C) n Standard POS: all variables in the domain appear in each sum term such as (A+B+C) Watch out the NOR term !! Ex# 1: (A+C)(A+B+C) standard POS = (A+C+BB)(A+B+C) =(A+B+C) Question: (A+C)(A+B) std. POS Ans: (A+B+C) 241 -208 CH 4 17
Std. SOP to std. POS Example: ABC+ABC+ABC 101 011 100 001 000 3 variables 23 = 8 possible combinations Remained terms: 111, 110, 010 Std. POS = (A+B+C)(A+B+C) 241 -208 CH 4 18
4. 7 Boolean Expressions and Truth Tables What u should know: Be able to convert SOP and POS expressions to truth tables and vice versa !! Convert SOP to truth table FACT SSOP is equal to 1 if at least one of the product term is 1. Step I : construct truth table for all possible inputs. Step II: convert SOP to SSOP Step III: Place “ 1” in the output column that makes the SSOP expression a “ 1” Step IV: Place “ 0” for all the remaining apart from Step III 241 -208 CH 4 EX: ABC+ABC+ABC 000 010 101 110 out=1 A B C Out 0 0 0 1 0 1 1 0 0 0 1 1 1 1 0 19
4. 7 Boolean Expressions and Truth Tables (cont. ) Convert POS to truth table FACT SPOS is equal to 0 if at least one of the sum term is 0. Step I : construct truth table for all possible inputs. Step II: convert POS to SPOS Step III: Place “ 0” in the output column that makes the SPOS expression a “ 0” Step IV: Place “ 1” for all the remaining apart from Step III 241 -208 CH 4 EX: (A+B+C)(A+B+C) 100 011 out=0 A B C Out 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 1 1 20
4. 7 Boolean Expressions and Truth Tables (cont. ) Convert truth table to SSOP Step 1: 2: 3: 4: Consider only output “ 1” Convert each binary value to the corresponding product term Repeat step 1&2 to get other product terms Write all product terms in a summation expression Convert truth table to SPOS Step 1: Consider only output “ 0” Step 2: Convert each binary value to the corresponding sum term (1 -> complement literal and 0 -> for literal) Step 3: Repeat step 1&2 to get other sum terms Step 4: Write all product terms in a product expression 241 -208 CH 4 Check this out: Example 4 -20, pp. 187 21
4. 8 The Karnaugh Map n n n The Karnaugh map is an array of cells in which each cell represents a binary value of the input variables. Can facilitate to produce the simplest SOP or POS expression The number of cells is 2 n, n is number of variables 3 variables so 8 cells Each cell differs from an adjacent cell by only one variable 241 -208 CH 4 Gray code The numbers are entered in gray code, to force adjacent cells to be different by only one variable. 22
4. 8 The Karnaugh Map (cont. ) C C AB ABC ABC How to read !! Full representation for 3 variables. (in fact it is n-Dimension truth table) Question : What about the map for 4 variables ? 241 -208 CH 4 23
4. 9 Karnaugh Map SOP Minimization Aim: You should be able to utilise K-Map to simplify Boolean expression to their minimum form. Convert SSOP to K-Map What we know is each product term in SSOP relates to “ 1” in corresponding truth table, but K-Map is, in deed, a form of n-dims truth table. Hence the way to convert SSOP to K-map is similar to the way to convert SSOP to truth table!! ABC+ABC+ABC 1 1 241 -208 CH 4 24
4. 9 Karnaugh Map SOP Minimization (cont. ) Convert non-standard SOP to K-Map Assume that the domain of Boolean is {A, B, C} and the expression we consider is A convert A (non-SOP) to SSOP as follows-: )= = A(B+B)(C+C ( AB+AB)(C+C( ABC+ABC+ABC Observe that A is related to all cells related to the binary “ 1” of A 241 -208 CH 4 1 1 25
4. 9 Karnaugh Map SOP Minimization (cont. ) How to minimize SOP expression ? n Grouping 1 s - Each group must contain 1, 2, 4, 8, or 16 cells - Each cell in a group must be adjacent to one or more cells in that same group, but all cells in the group do not have to be adjacent to each other. - Always include the largest possible number of 1 s in a group - Each 1 on the map must be included in at least one group. The 1 s already in a group can be included in another group as long as the overlapping groups include non-common 1 s. 241 -208 CH 4 26
4. 9 Karnaugh Map SOP Minimization (cont. ) 1. Group the 1’s into two overlapping groups as indicated. 2. Read each group by eliminating any variable that changes across a boundary. B changes across this boundary C changes across this boundary 3. The vertical group is read AC. 4. The horizontal group is read AB. X = AC +AB 241 -208 CH 4 27
4. 9 Karnaugh Map SOP Minimization (cont. ) C changes across outer boundary B changes C changes X 241 -208 CH 4 1. Group the 1’s into two separate groups as indicated. 2. Read each group by eliminating any variable that changes across a boundary. 3. The upper (yellow) group is read as AD. 4. The lower (green) group is read as AD. X = AD +AD 28
4. 9 Karnaugh Map SOP Minimization (cont. ) ABC AC 1 ABC 1 1 AB AB 1 BC D 1 1 1 BC 1 1 1 1 Some examples of grouping 241 -208 CH 4 29
4. 9 Karnaugh Map SOP Minimization (cont. ) AB 1 1 1 1 Ex 1: Map and minimize the following std. SOP expression on a AC Karnaugh map: A B C+ABC+A B C 000 001 110 100 Answer: A B+AC 241 -208 CH 4 30
4. 9 Karnaugh Map SOP Minimization (cont. ) B 1 1 1 1 Ex 2: Map and minimize the following SOP expression on a Karnaugh map: A B +ABC+A B C 110 111 010 011 241 -208 CH 4 Answer: B 31
4. 9 Karnaugh Map SOP Minimization (cont. ) Mapping Directly from a Truth Table A 0 0 1 1 241 -208 CH 4 B 0 0 1 1 C 0 1 0 1 Out 1 0 0 0 1 x 1 Out = AB+BC 32
4. 10 Karnaugh Map POS Minimization A+B 0 0 0 A+C 0 0 the following std. POS expression on Ex 1: Map and minimize 0 a Karnaugh map: (A+B+C)(A+B+C) A+B+C 000 001 110 Answer: (A+B)(A+C)(A+B+C) 241 -208 CH 4 33
4. 10 Karnaugh Map POS Minimization (cont. ) A 0 0 0 0 Ex 2: Map and minimize the following POS expression on a Karnaugh map: (A+B)(A+B+C) 000 001 010 011 Answer: A 241 -208 CH 4 34
4. 10 Karnaugh Map POS Minimization (cont. ) (B+C+D)(A+B+C+D)(A+B+C+D) 0000 1000 0010 0110 1011 1001 (B+D) 0 1010 (A+C+D) 0 0 (A+B) 0 0 Answer: (B+D)(A+B)(A+C+D) 241 -208 CH 4 35
Converting Between POS and SOP Using Karnaugh Map (B+C+D)(A+B+C+D)(A+B+C+D) 0000 1000 0010 0110 (B+D) 0 1011 (A+C+D) 0 0 1010 AD 0 1 1 0 0 1 1 1 1 0 0 0 Min POS: (B+D)(A+B)(A+C+D) 241 -208 CH 4 BC 0 (A+B) 0 1001 Min SOP: AB+BC+AD AB 36
7 -segment decoding Logic Digit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 241 -208 CH 4 D 0 0 0 0 1 1 1 1 C 0 0 0 0 1 1 1 1 B 0 0 1 1 A 0 1 0 1 a b c d e f g 1 0 1 1 1 x x x 1 1 1 0 0 1 1 1 x x x 1 1 0 1 1 1 1 x x x 1 0 1 1 x x x 1 0 0 0 1 0 x x x 1 0 0 0 1 1 1 0 1 1 x x x 37
Karnaugh Map Minimization of the Segment Logic SOP for segment a: DC BA+DCBA+DCBA+DCBA CA 1 CA D 1 1 1 x x B Minimum SOP expression: D+B+CA+CA 241 -208 CH 4 38
- Slides: 38