Gate Level Minimization Map Method Complexity of hardware implementation is directly related to the complexity of the algebraic expression Truth table representation of a function is unique Algebraically there can be many different but equivalent forms Boolean expressions may be simplified by algebraic means Awkward because it lacks specific rules to predict each succeeding step in the manipulative process Map method is a simple, straightforward procedure for minimizing Boolean functions Karnaugh map or K-map 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 1
Gate Level Minimization Map Method Map Method K-map is a diagram made up of squares, with each square representing one minterm of the function that is to be minimized Presents a visual diagram of all possible ways a function may be expressed in standard form By recognizing various patterns one can derive alternative algebraic expressions from which the simplest can be selected The simplified expressions are always in one of the two standard forms: sum of products or product of sums Assume that simplest algebraic expression has the minimum number of terms with the smallest possible number of literals in each term Should generate a circuit with a minimum number of gates and the minimum number of inputs to each gate 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 2
Two-Variable K-MapK There are four minterms for two variables Map (a) consists of four squares, one for each minterm Map (b) shows the relationship between the squares and the two variables x and y 0 and 1 marked in each row and column designate the values of variables x is primed in row 0 and unprimed in row 1 y is primed in column 0 and unprimed in column 1 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 3
Two-Variable K-MapK If we mark the squares whose minterms belong to a given function, the two-variable map represents any one of the 16 Boolean functions of two variables Function xy shown (a) xy = m 3 1 is placed inside m 3 minterm square Function x + y shown in (b) 1's placed in minterm squares m 1 + m 2 + m 3 = x'y + xy' + xy = x + y 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 4
Three-Variable K-MapK Eight minterms for three binary variables Minterms are arranged similar to the Gray code, that is only one bit changes in value from one adjacent column to the next Map in (b) is marked with numbers in each row and each column to show the relationship between the squares and the three variables ie. m 5 corresponds to row 1 and column 01 Get 101 2 which is 5 10 when concatenated Any two adjacent squares in the map differ by only one variable, which is primed in one square and unprimed in the other Note m 0 & m 2, and m 4 & m 6 are adjacent 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 5
Three-Variable K-Map: K Ex. 1 Given: F(x, y, z) = (2, 3, 4, 5) Mark a 1 in each minterm square (010, 011, 100, and 101) Find possible adjacent squares (shaded rectangles) The upper right rectangle represents by x'y The lower left rectangle represents by xy' Sum of four minterms can be replaced by a sum of only two product terms: F = x'y + xy' 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 6
Three-Variable K-Map: K Ex. 2 Given: F(x, y, z) = (3, 4, 6, 7) Minterms are marked with 1's Two adjacent squares are combined in the third column to give the term yz The remaining two squares with 1's are also adjacent by wrapping, resulting in the term xz' Simplified function: F = yz + xz' 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 7
Three-Variable K-Map: K Ex. 3 Given: F(x, y, z) = (0, 2, 4, 5, 6) Minterms are marked with 1's Combine the four adjacent squares in the first and last columns to give the term z' m 5 is combined with an adjacent square that has already been used Desirable because the two adjacent squares gives fewer literals (xy') compared to xy'z Simplified function: F = z' + xy' 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 8
Three-Variable K-Map: K Ex. 4 Given: F = A'C + A'B + AB'C + BC Express as sum of minterms: A'C = m 1 + m 3 A'B = m 3 + m 2 AB'C = m 5 BC = m 3 + m 7 Remove duplicates: F (A, B, C) = (1, 2, 3, 5, 7) Minimal sum-of-products expression from map: F = C + A'B 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 9
Four-Variable K-MapK Four binary variables (w,x,y,z) 16 squares NOTE numbering! One square One term, four literals Two adjacent squares One term, three literals Four adjacent squares One term, two literals Eight adjacent squares One term, one literal 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 10
Four-Variable K-Map: K Ex. 1 F (w, x, y, z) = (0,1,2,4,5,6,8,9,12,13,14) Fill map Eight adjacent squares on left form the term y' Three 1's on right can wrap to left to form terms w'z' and xz' Simplified function: F = y' + w'z' + xz' 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 11
Four-Variable K-Map: K Ex. 2 Given: F = A'B'C' + B'CD' + A'BCD' + AB'C' Find minterms: A'B'C' = m 0 + m 1 B'CD' = m 2 + m 10 A'BCD' = m 6 AB'C' = m 8 + m 9 New function: F (A, B, C) = (0,1,2,6,8,9,10) The simplified function: F = B'D' + B'C' + A'CD' 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 12
Prime Implicants Prime implicant is a product term obtained by combining the maximum possible number of adjacent squares in the map It cannot be combined with another term to eliminate a variable If a minterm in a square is covered by only one prime implicant, that prime implicant is said to be essential 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 13
Given: F(A, B, C, D) = (0, 2, 3, 5, 7, 8, 9, 10, 11, 13, 15) Minterms marked on partial map m 3, m 9, and m 11 are omitted for now Partial map shows two essential prime implicants with only two literals Prime Implicants 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 14
Prime Implicants m 3, m 9, and m 11 are handled with more prime implicants: m 3 can be covered with either CD or B'C m 9 can be covered with either AD or AB' m 11 is covered with any one of the above four prime implicants BD and B'D' are prime implicants since m 0 and m 5 are covered once by them Four possible functions: F = BD + B'D' + CD + AD = BD + B'D' + CD + AB' = BD + B'D' + B'C + AD = BD + B'D' + B'C + AB' 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 15
AB CDE 00 Five-Variable K-MapK D 000 001 011 010 110 111 101 100 m 0 m 1 m 3 m 2 m 6 m 7 m 5 m 4 A 01 11 10 m 8 m 9 m 11 m 10 m 14 m 15 m 13 m 12 m 24 m 25 m 27 m 26 m 30 m 31 m 29 m 28 m 16 m 17 m 19 m 18 m 22 m 23 m 21 m 20 B E E C 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 16
Six-Variable K-MapK E DEF ABC 000 001 011 010 110 111 101 100 000 m 0 m 1 m 3 m 2 m 6 m 7 m 5 m 4 001 011 m 8 m 9 m 11 m 10 m 14 m 15 m 13 m 12 m 24 m 25 m 27 m 26 m 30 m 31 m 29 m 28 C B 010 110 m 16 m 17 m 19 m 18 m 22 m 23 m 21 m 20 m 48 m 49 m 51 m 50 m 54 m 55 m 53 m 52 111 m 56 m 57 m 59 m 58 m 62 m 63 m 61 m 60 C A 101 m 40 m 41 m 43 m 42 m 46 m 47 m 45 m 44 100 m 32 m 33 m 35 m 34 m 38 m 39 m 37 m 36 F F 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 17 D
Product-of of-sums Simplification F (A, B, C, D) = (0, 1, 2, 5, 8, 9, 10) Mark 1's, simplify: F = B'D' + B'C' + A'C'D Mark 0's, simplify: F' = AB + CD + BD' DeMorgan's theorem: F = (A'+B')(C'+D')(B'+D) 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 18
Product-of of-sums Simplification Standard forms: Sum-of-products: a group of AND gates and a single OR gate Product-of-sums: a group of OR gates and a single AND gate Assumed that the complement of input variables are available Either forms two levels of gates (two-level implementation) First has 3 inputs on one of the AND gates 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 19
Product-of of-sums Simplification Sum of minterms: F(x, y, z) = (1, 3, 4, 6) F = x'z + xz' Product of maxterms: F(x, y, z) = (0, 2, 5, 7) F' = xz + x'z' F = (x' + z')(x + z) To fill a map with a function expressed in product-of-sums form: Use the complement of the function to find the squares that are to be marked by 0's Mark the remaining squares with 1's 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 20
Don't-Care Conditions Sum of the minterms specifies the conditions under which the function is equal to 1 (0 for the rest of the minterms) Assumes all the combinations are valid It is possible that some combinations are not defined Eg. 4-bit BCD only has 10 out of 16 states valid minterms may have don't-care conditions incompletely specified functions Use don't-care conditions to further simplify the Boolean expression Can be either a 0 or 1, use X to distinguish In choosing adjacent squares set X's to be whatever creates simplest function 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 21
Don't-Care Conditions 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 22
NAND Implementation NAND gate is a universal gate since any logic circuit can be implemented with it Complement is a oneinput NAND gate Can also be a two-input NAND gate with inputs shorted AND is two NAND gates OR is a NAND gate with complemented inputs 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 23
NAND Implementation Obtain simplified Boolean function and then convert the function to NAND logic Sum-of-products Switch AND OR circuits to NAND Use alternative graphic symbols for the NAND gate: AND-invert Invert-OR 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 24
NAND 2-Level 2 Implementation: Ex. 1 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 25
NAND 2-Level 2 Implementation: Ex. 2 Given: F(x, y, z) = (1, 2, 3, 4, 5, 7) Simplified: F = xy' + x'y + z 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 26
F = A (CD + B) + BC' Multi-Level NAND Implementation: Ex. 1 In general: 1. Convert all AND to AND-invert 2. Convert all OR to invert-or 3. Check bubbles; insert inverters or complement literals if necessary 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 27
Multi-Level NAND Implementation: Ex. 2 F = (AB' + A'B)(C + D') 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 28
NOR Implementation NOR gate is also a universal gate since any logic circuit can be implemented with it Complement is a oneinput NOR gate Can also be a two-input NOR gate with inputs shorted OR is two NOR gates AND is a NOR gate with complemented inputs 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 29
NOR Implementation Obtain simplified Boolean function and then convert the function to NOR logic Product-of-sums Switch OR-AND circuits to NOR Use alternative graphic symbols for the NOR gate: OR-invert Invert-AND 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 30
NOR Implementation: Ex. 1 F = (A + B)(C + D)E F = (AB' + A'B)(C + D') 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 31
Exclusive-OR Denoted by: x y = xy' + x'y Equal to 1 if x is not equal to y Exclusive-NOR (equivalence; XNOR) (x y)' = xy + x'y' Equal to 1 if x is equal to y Both are commutative and associative Can be implemented with standard gates 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 32
XOR: Odd Function A B C = (AB' + A'B)C' + (AB + A'B')C = AB'C' + A'BC' + ABC + A'B'C = (1, 2, 4, 7) A B C D = (AB' + A'B) (CD' + C'D) = (AB' + A'B)(CD + C'D') + (AB + A'B')(CD' + C'D) = (1, 2, 4, 7, 8, 11, 13, 14) XOR is an odd function since it is 1 whenever the sum of the inputs is odd Complement of F is an even function XOR/XNOR function cannot be reduced 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 33
XOR: Parity Generation/Checking Generate even (including parity bit) parity: P = x y z Check even parity: C = x y z P Same circuit if P = 0 2018 Roberto Muscedere Images 2013 Pearson Education Inc. 34