1 Digital Logic Design Week 5 Simplifying logic expressions
2 Algebraic method – Standard forms (Algebraic way to represent any logic function) – Simplification using Boolean algebra K-Map method (Karnaugh maps) – 2, 3, 4 variable expressions – 5, 6 variable expressions (NOT) VEM (Variable entered mapping) (NOT) Simplifying logic expressions
3 Standard forms All Boolean expressions can be converted into either of two forms: Sum-of-products (SOP) form Product-of-sums (POS) form
4 Sum-of-products (SOP) Sum-of-products (SOP) expressions formed by summing (Boolean addition-ORing) product terms (ANDed terms). Example: AND gates form products OR gate forms the sum
5 Standard sum-of-products form Standard SOP expression All variables in the domain appear in each product term in the expression Example: A minterm is a product term involving all variables in the domain Standard SOP expressions often called sum of minterms
6 Truth tables from standard SOP form Complete the truth table for X = Place a 1 in output column for each input combination that makes X = 1 Place a 0 in remaining rows ABCX ABCX
7 Product-of-sums (POS) Product-of-sums (POS) expressions are sum terms “multiplied” together Examples: The following expressions are not in POS form: Remember: “multiplication” here means ANDed together
8 Product-of-sums (POS) Example: AND gate forms the product OR gates form sums
9 Standard product-of-sums form Standard POS expression All variables in the domain appear in each sum term in the expression Example: A maxterm is a sum term involving all variables in the domain Standard POS expressions often called product of maxterms
10 Truth tables from standard POS form ABCX Complete the truth table for X = Place a 0 in output column for each input combination that makes X = 0 Place a 1 in remaining rows ABCX
11 Standard expressions from a truth table Four 1’s in output column, corresponding to minterms Four 0’s in output column, corresponding to maxterms Find standard SOP and standard POS expressions for X ABCX
12 Algebraic method – Standard forms (Algebraic way to represent any logic function) – Simplification using Boolean algebra K-Map method (Karnaugh maps) – 2, 3, 4 variable expressions Simplifying logic expressions
13 Simplified Boolean expressions results in efficient hardware implementations Simpler expressions → fewer gates → faster & uses less power Simplification using Boolean algebra applies laws: commutative, associative, distributive rules A+1=1, A+0=A, A·A’=0, A+A=A, A+BC=(A+B)·(A+C), A’’=A, … De Morgan’s theorem (A·B)’=A’+B’(A+B)’=A’·B’ Also needs skill, persistence and often luck! Simplification using Boolean algebra
14 Sensors: Oil pressureHIGH/NORMALA=1 : pressure HIGH TemperatureHIGH/NORMALB=1 : temp. HIGH Flow rateHIGH/NORMALC=1 : flow HIGH Output AlarmON/OFFF=1 : alarm ON Alarm ON only when: oil pressure is NORMAL, temperature is HIGH and flow is NORMAL, or oil pressure is HIGH and flow or temperature is NORMAL, or flow is HIGH and temperature is HIGH Example: alarm system
15 Alarm system: our first solution Logisim file Week05_1.circ in the course site
16 Alarm system: our simplified solution Week05_2.circ Alarm circuit doesn’t even need flow rate measurement!
17 Simplifying the solution RESULT: Boolean algebra simplification relies on: Laws, rules, theorems, skill and patience
18 Karnaugh-map (K-map) is organised as a matrix of squares, where each square represents a minterm (ANDed variables, ex: AB’C) adjacent squares always differ by just one literal (so that the unifying theorem may apply: a + a' = 1) It is another way of representing truth table of a logic circuit For 2-variable case (e.g.: variables a,b), the map can be drawn as: K-maps a b equivalent to: a b
19 You will have noticed that the order of binary bits above the box is not in the standard binary sequence (00, 01,10,11). It is arranged so that the values for adjacent columns vary by only a single bit (00, 01, 11, 10). This sequence is known as grey code and it is a key factor in the way Karnaugh maps work. K-maps
20 Using K-maps The Boolean expression can then be entered into the Karnaugh map Like a truth table, a 1 is entered into the grid to show when the Boolean expression is true.
21 Simplification using Karnaugh maps After Karnaugh map has been filled in for a given expression, simplification is a 2-step process: 1.Group the 1’s Groups to enclose adjacent cells Groups must be square or rectangular, and contain 1,2,4,8 or 16 cells Goal is to: Cover all 1’s at least once Maximise size of groups Minimise number of groups 2.Determine simplified SOP expression
22 22 of 13 Using a Karnaugh Map The next stage is to group 1s together. Loops should be drawn starting with the largest possible loop, and additional loops should then be drawn until all the 1s are included in a loop. Loops should always be made as large as possible, and adjacent 1s can be included into more than one loop. Adjacent 1s can be looped together in horizontal and vertical groups of 2, 4 or 8, but never diagonally. Single 1s should be looped by themselves. Since each loop results in a separate term, the smallest number of loops created will result in the simplest expression.
23 of 13 Using a Karnaugh Map Each group of 1s is a separate term in the final simplified expression that can be determined by inspection. The first loop in the example groups together 1s for both A and C irrespective of the state of B. The expression is therefore A.C The last loop in the example is for a single term, and so cannot be simplified. A.B.C The second loop groups together 1s for both A and B irrespective of the state of C. The expression is therefore A.B
24 From truth table to Karnaugh map A B C F
25 From truth table to Karnaugh map Draw the Karnaugh map for the expression defined by the following truth table ABCXminterms A’B’C 0101A’BC’ ABC’ 1111ABC
26 26 of 13 Groups of 1s can be grouped together as shown to get the following simplified equation. Here is a four-input problem and its associated Truth Table and Karnaugh map. Karnaugh Maps With More Variables