UNIT 4 MINTERM AND MAXTERM EXPANSIONS Spring 2
Minterm and Maxterm Expansions 2 Contents Conversion of English sentences to Boolean equations Combinational logic design using a truth table Minterm and maxterm expansions Incompletely specified functions Examples of truth table construction Design of binary adders Reading Unit 4 Words Translation IC
Objectives 3 Design a combinational logic circuit starting with a word description of the desired circuit behavior Steps:. Translate the word description into a switching function Boolean expression or truth table 2. Simplify the function 3. Realize it using available logic gates e.g., Mary watches TV if it is Monday night and she has finished her homework Translate Mary watches TV (F) if It is Monday night (A) And A She has finished her homework (B) F = A B B F=A B
Example: Designing an Alarm 4 The alarm will ring iff the alarm switch is turned on and the door is not closed, or it is after 6 P.M. and the window is not closed Translate The alarm will ring (Z) iff The alarm switch is on (A) and the door is NOT closed (B') Or It is after 6 P.M. (C) and the window is NOT closed (D') Z = A B' + C D' A B Z C D
5 Logic Design using a Truth Table A truth table helps translation
Threshold Detector (/2) 6 Design a detector that outputs when input is greater than 2 Inputs (A, B, C) 2 represent a binary number N; if N = (A, B, C) 2 3 = 2, output f = ; otherwise f = 2 3 4 5 6 7 A B C f f A B C N > 2? Show the condition to make output == f 3 4 5 6 7 B f = A'BC + AB'C' + AB'C + ABC' + ABC (SOP) = A'BC + ABC + AB'C' + AB'C + ABC' + ABC C = A + BC (Simplified using Boolean Algebra, Units 2&3) A f
Threshold Detector (2/2) 7 Counting s, we have SOP What if counting s? 2 3 4 5 6 7 A B C f f 2 f' = A'B'C' + A'B'C + A'BC' Taking the complement by DeMorgan s law, f = (A'B'C' + A'B'C + A'BC')' = [(A' B' C')+(A' B' C)+(A' B C')]' = (A + B + C)(A + B + C')(A + B' + C) (POS) A B C N > 2? Show the condition to make output == f
Summary: Logic Design using a Truth Table 8 General steps:. Make a truth table according to the word description 2. Generate a Boolean expression SOP: check s POS: check s First of all, have f' in SOP, then derive f in POS 3. Simplify the Boolean expression Words Translation IC
9 Minterm & Maxterm Expansions
Minterm vs. Maxterm Definition: A minterm/maxterm of n variables is a product/sum of n literals in which each variable appears exactly once in either true or complement form (but not both) A literal is a variable or its complement, e.g., A, A' e.g., assume 3 variables Minterm: A'BC, AB'C' Maxterm: A+B+C, A+B+C' (m i )' = M i DeMorgan Each minterm corresponding one input condition Row No. ABC Minterms m i Maxterms M i m = A B C M = A + B + C m = A B C M = A + B + C 2 m 2 = A B C M 2 = A + B + C 3 m 3 = A B C M 3 = A + B + C 4 m 4 = A B C M 4 = A + B + C 5 m 5 = A B C M 5 = A + B + C 6 m 6 = A B C M 6 = A + B + C 7 m 7 = A B C M 7 = A + B + C
Minterm Expansion A minterm expansion or a standard sum of products: a function is written as a sum of minterms i.e., counting s e.g., f = A'BC + AB'C' + AB'C + ABC' + ABC = m 3 + m 4 + m 5 + m 6 + m 7 (m-notation) = Σ m(3, 4, 5, 6, 7) A B C N > 2? f Row No. ABC Minterms m i Maxterms M i m = A B C M = A + B + C m = A B C M = A + B + C 2 m 2 = A B C M 2 = A + B + C 3 m 3 = A B C M 3 = A + B + C 4 m 4 = A B C M 4 = A + B + C 5 m 5 = A B C M 5 = A + B + C 6 m 6 = A B C M 6 = A + B + C 7 m 7 = A B C M 7 = A + B + C
Maxterm Expansion 2 A maxterm expansion or a standard product of sums: a function is written as a product of of maxterms i.e., counting s e.g., f' = A'B'C' + A'B'C + A'BC' f = (A + B + C)(A + B + C')(A + B' + C) = M M M 2 (M-notation) = Π M(,, 2) A B C N > 2? f Row No. ABC Minterms m i Maxterms M i m = A B C M = A + B + C m = A B C M = A + B + C 2 m 2 = A B C M 2 = A + B + C 3 m 3 = A B C M 3 = A + B + C 4 m 4 = A B C M 4 = A + B + C 5 m 5 = A B C M 5 = A + B + C 6 m 6 = A B C M 6 = A + B + C 7 m 7 = A B C M 7 = A + B + C
Complement using Minterms/Maxterms 3 (m i )' = M i Complement of f:. Count s in f (find f' directly) f' = m + m + m 2 = Σ m(,, 2) f' = M 3 M 4 M 5 M 6 M 7 = Π M(3, 4, 5, 6, 7) 2. Count s in f (find f and then complement it) f' = (f)' = (m 3 + m 4 + m 5 + m 6 + m 7 )' = m 3 'm 4 'm 5 'm 6 'm 7 ' = M 3 M 4 M 5 M 6 M 7 = Π M(3, 4, 5, 6, 7) f' = (f)' = (M M M 2 )' = M ' + M ' + M 2 ' = m + m + m 2 = Σ m(,, 2) A B C f f
Example: Minterm/Maxterm Expansion 4 e.g., f(a, b, c, d) = a'(b' + d) + acd' f(a, b, c, d) = a'(b' + d) + acd' = a'b' + a'd + acd' = a'b'(c + c')(d + d') + a'd(b + b')(c + c') + acd'(b + b') = a'b'c'd' + a'b'c'd + a'b'cd' + a'b'cd + a'bc'd + a'bcd + abcd' + ab'cd' = Σ m(,, 2, 3, 5, 7,, 4) (Minterm Expansion) = Π M(4, 6, 8, 9,, 2, 3, 5) (Maxterm Expansion)
Summary (/2) 5 Convert a Boolean expression to a minterm/maxterm expansion Use truth table Sometimes there are too many terms Use Boolean algebra SOP multiply out and use (X + X')= minterm expansion POS factor and use XX'= maxterm expansion
Summary (2/2) 6 Convert between a minterm and a maxterm expansion If f = Σ m i, then f = Π M j, where each m j is not in f DESIRED FORM Minterm Maxterm Minterm Maxterm Expansion of f Expansion of f Expansion of f' Expansion of f' GiVEN FORM Minterm Expansion of f Maxterm Expansion of f -------------- minterm nos. are those nos. not on the maxterm list for f maxterm nos. are those nos. not on the minterm list for f -------------- list minterms not present in f minterm nos. are the same as maxterm nos. of f maxterm nos. are the same as minterm nos. of f list maxterms not present in f There is a -to- mapping between a truth table and the minterm/maxterm expansion
AND of Two Minterm Expansions 7 e.g., Given f = Σ m(, 2, 3, 5, 9, ), f 2 = Σ m(, 3, 9,, 3, 4), find f f 2 =? AND: take the numbers that appear in both expansions: f f 2 = Σ m(, 3, 9, ) Q: What if AND for two maxterm expansions?
General Truth Table 8 Q: Given three Boolean variables A, B, C, how many different Boolean functions can you produce? A: A B C f Each a i can be assigned with either or 2 8 = 256 a a a 2 a 3 a 4 a 5 a 6 a 7
9 Incompletely Specified Functions
Incompletely Specified Functions (/2) 2 A large digital system is usually divided into subcircuits Assume N never generates ABC = / for any w, x, y, z 2 3 4 5 6 7 A B C F x x w x y z N don t care (DC) terms can be assigned with either or A B C N2 F F: Incompletely specified function A'B'C, ABC': don t care terms
Incompletely Specified Functions (2/2) 2 Impact of don t care terms on Boolean simplification: Try exhaustive combinations of DCs to find the best expression (may be stupid but works for now). Assign to both X : F = A'B'C' + A'BC + ABC = A'B'C' + BC 2. Assign to st X, and to 2 nd X : F = A'B'C' + A'B'C + A'BC + ABC = A'B' + BC 3. Assign to both X : F = A'B'C' + A'B'C + A'BC + ABC' + ABC = A'B' + BC + AB 4. 2. is the simplest solution Notation: F = Σ m(, 3, 7) + Σ d(, 6) F = Π M(2, 4, 5) Π D(, 6) don t care minterm and maxterm have the same numbers 2 3 4 5 6 7 A B C F x x
22 Truth Table Construction
Error Detector for 6-3-- Codes (/2) 23 Design an error detector for 6-3-- codes: The output F = iff inputs (A, B, C, D) represent an invalid code combination ABCD F Decimal digit 2 3 4 5 6 7 8 9 6-3-- code. Construct the truth table
Error Detector for 6-3-- Codes (2/2) 24 ABCD F 2. Simplify the function F(A, B, C, D) = Σ m(2, 6,, 3, 4, 5) = A'B'CD' + A'BCD' + AB'CD' + ABCD' + ABC'D + ABCD = A'CD' + ACD' + ABD = CD' + ABD C D' A B D 3. Realize it F
25 A B C D Example: Truth Table Construction Decimal digit 2 3 4 5 6 7 8 9 The output Z = iff the 8-4-2- BCD number (A, B, C, D) is divisible by 3 BCD % 3 ==? 8-4-2- code Z. Construct the truth table ABCD Z X X X X X X 2. Simplify the function Z(A, B, C, D) = Σ m(, 3, 6, 9) + Σ d(,, 2, 3, 4, 5) Logic minimization using Karnaugh map (Unit 5) 3. Realize it
26 Binary Adders and Subtractor Divide-and-conquer
-Bit Half Adder (HA) 27 Addition table: + + + + 2. Simplify the function. Construct the truth table carry sum C = XY S = X'Y + XY' = X Y X Y Z C S X 3. Realize it S Y C
-Bit Full Adder (FA) 28 X Y C in. Construct the truth table X Y C in C out S Full Adder X Y + C in C out S X Y C in C out Sum 3. Realize it 2. Simplify the function C out = X'YC in + XY'C in + XYC in ' + XYC in = XY + XC in + YC in S = X'Y'C in + X'YC in ' + XY'C in ' + XYC in = X Y C in S X Y X C in Y C in C out
29 Designing a 4-Bit Parallel Adder (/3) A = (A 3 A 2 A A ), B = (B 3 B 2 B B ) Carry out A 3 A 2 A A + B 3 B 2 B B C 4 S 3 S 2 S S C Carry in A + B e.g., Carries C (=) How? Use a single truth table? Too big! C 4 S 3 S 2 S 4-bit Parallel Adder S C A 3 B 3 A 2 B 2 A B A B
Designing a 4-Bit Parallel Adder (2/3) 3 Decompose the 4 bit adder into four modules Each module adds two bits and a carry use full adder Extend to negative numbers Consider one s complement (What if two s complement?). Add just as if all numbers were positive 2. End-around carry: Add the carry out back to the rightmost bit How to detect overflow? Check sign! Add(+A, +B) A+B < 2 n- +3 +4 +7 (+) + (+) (-) or (-) + (-) (+) Add(+A, -B) B > A +5-6 - Add(-A, +B) B > A -5 +6 + () Add(-A, -B) A+B 2 n- -3-4 -7 ()
Designing a 4-Bit Parallel Adder (3/3) 3 S 3 S 2 S S C 4 C 3 Full Full Full Adder Adder Adder C 2 C Full Adder C A 3 B 3 A 2 B 2 A B A B Overflow detection? A B S A 3 B 3 S 3 Overflow + + - - - + end-around carry for s complement V = A 3 'B 3 'S 3 + A 3 B 3 S 3 '
Designing a Binary Subtractor (/2) 32 Consider A B = A + (-B) in 2 s complement A B = A + (-B) = A + B* = A + B_ + Convert B to 2 s complement: inverse and then add Discard the carry from the sign bit S 4 S 3 S 2 S C 5 (Ignore last carry ) Full Adder C 4 Full Adder C 3 Full Adder C 2 Full Adder C = B 4 ' B 3 ' B 2 ' B ' A 4 B 4 A 3 B 3 A 2 B 2 A B
Designing a Binary Subtracter (2/2) 33 Or design a full subtracter X Y = D (difference), B: borrow DIY! Cell i x i - y i - b i b i+ d i d n d i d 2 d b n+ Full Subtracter Full Subtracter b n b i+ b i b 3 Full b 2 Full b = Subtracter Subtracter x n y n x i y i x 2 y 2 x y