Logic Design CS221 1 st Term K-Map Cairo University Faculty of Computers and Information
13/10/2009 cs221 – sherif khattab 2 Administrivia imagine cup (imaginecup.com): tutorial session, in seminar room bonus winners (correct answer + explanation) Mostafa Ahmed Sayed Mostafa Mohamed Mostafa Mido Talaat, Aya Elkady Mohamed Mahmoud Sayed Ahmed Emad Samy Yossef lab 2 is significantly longer than lab 1 subject must include the word CS221 project groups: GA and GB
13/10/2009 cs221 – sherif khattab 3 boolean functions input -> output binary variables (and constants) and logic operations defined by a truth table for two variables, only 16 boolean functions possible. why? how many possible truth tables? for n variables, 2 2 n boolean functions
13/10/2009 cs221 – sherif khattab 4 gate-level minimization Boolean function representation truth table: one way algebraic form (and logic circuit): many ways simplest and cheapest circuit minimum # terms -> min. # gates minimum # literals per term -> min. # inputs to each gate not unique gate-level minimization automatic (logic synthesis software) manual algebraic: awkward map method: simple, straightforward (Karnaugh map or K-map)
13/10/2009 cs221 – sherif khattab 5 map diagram of squares each square represents one minterm (one row in truth table) For 2 variables: 4 minterms x'y', x'y, xy', xy columns in which x = 1
13/10/2009 cs221 – sherif khattab 6 two-variable map Example: F = xy
13/10/2009 cs221 – sherif khattab 7 two-variable map Example: F = x + y = x (y + y') + y (x + x') = xy + xy' + x'y
13/10/2009 cs221 – sherif khattab 8 Gray code only one bit changes from number to next: 7 -> 0100 8 -> bit Gray code 00, 01, 11, 10
13/10/2009 cs221 – sherif khattab 9 three-variable map 8 minterms column sequence in Gray code row 1 and column 01 -> 1 01 = 5 -> m 5 row x and column y'z -> x y'z
13/10/2009 cs221 – sherif khattab 10 2 adjacent cells each two adjacent cells differ in how many variables (bits)? sum (OR) of two adjacent cells -> one AND e.g., m 5 + m 7 = xy'z + xyz = xz (y + y') = xz e.g., m 1 + m 5 = x'y'z + xy'z = y'z (x + x') = y'z
13/10/2009 cs221 – sherif khattab 11 2 adjacent cells m 0, m 1 adjacent? m 0, m 5 adjacent? m 0, m 2 adjacent? m 4, m 6 adjacent?
13/10/2009 cs221 – sherif khattab 12 4 adjacent cells sum (OR) of four adjacent cells -> one literal e.g., m 1 + m 3 + m 5 + m = x'y'z + x'yz + xy'z + xyz = x'z (y + y') + xz (y + y') = x'z + xz = z (x + x') = z
13/10/2009 cs221 – sherif khattab 13 4 adjacent cells
13/10/2009 cs221 – sherif khattab 14 3-variable map simplification 1 cell -> three literals (e.g., xyz) 2 adjacent cells -> two literals (e.g., xy) 4 adjacent cells -> one literal (e.g., z) 8 adjacent cells -> ??
13/10/2009 cs221 – sherif khattab 15 example 1 F = ∑(2,3,4,5) = (010, 011, 100, 101) = xy' + x'y
13/10/2009 cs221 – sherif khattab 16 example 2 F = ∑(3,4,6,7) = yz + xz'
13/10/2009 cs221 – sherif khattab 17 example 3 F = ∑(0,2,4,5,6) = z' + xy'
13/10/2009 cs221 – sherif khattab 18 example 4 F = A'C + A'B + AB'C + BC (what form?) =
13/10/2009 cs221 – sherif khattab 19 four-variable map ?? minterms column sequence in Gray code row 01 and column 01 -> = 5 -> m 5 row w'x and column y'z -> w'x y'z
13/10/2009 cs221 – sherif khattab 20 4-variable map simplification 1 cell -> four literals (e.g., wxyz) 2 adjacent cells -> three literals (e.g., w'xy) 4 adjacent cells -> two literals (e.g., wz) 8 adjacent cells -> one literal (e.g., x) 16 adjacent cells -> 1 adjacent?
13/10/2009 cs221 – sherif khattab 21 example 1 F = ∑(0,1,2,4,5,6,8,9,12,13,14) =
13/10/2009 cs221 – sherif khattab 22 example 2 F = A'B'C' + B'CD' + A'BCD' + AB'C' =
13/10/2009 cs221 – sherif khattab 23 5-variable map ?? minterms the two 4-variable maps on top of each other
13/10/2009 cs221 – sherif khattab 24 5-variable map simplification
13/10/2009 cs221 – sherif khattab 25 example F = ∑(0,2,4,6,9,13,21,23,25,29,31)