EE210: Switching Systems Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps Prof. YingLi Tian Feb. 21/26, 2019 Department of Electrical Engineering The City College of New York The City University of New York (CUNY) 1
Create Truth Table The system has four inputs. The first two, a and b, represent a number in the range 1 to 3 (0 is not used). The other two, c and d, represent a second number in the same range. The output, y, is to be 1 if and only if the first number is greater than the second or the second is 2 greater than the first. 2
3
Create Truth Table The system has four inputs, a, b, c, and d, and one output, f. The last three inputs (b, c, d) represent a binary number, n, in the range 0 to 7; however, the input 0 never occurs. The first input (a) specifies which of two computations is made. a 0: f is 1 iff n is a multiple of 2 a 1: f is 1 iff n is a multiple of 3 4
5
Manipulation of Algebraic Functions In addition to simplification, manipulation is needed sometimes to put an expression in a certain format such as SOP, sum of minterms, POS, or product of maxterms etc. For example, only use two-input gates. SOP: x y + xy + xyz Sum of minterms: xyz + x yz POS: (x + y )(x + y)(x + z ) Product of maxterms: (x+y+z)(x + y+ z ) 6
Manipulation of Algebraic Functions P14a: ab + a c = ( a + c)(a + b) Example: Implement the following function by using only two-input gates f = ab c + a c d +bd = c (ab + a d ) + bd A volunteer to draw the two-input gate circuit: a) Use AND and OR gates b) Use NAND gates 7
Manipulation of Algebraic Functions Example: Implement the function by using only two-input gates f = ab c + a c d +bd = c (ab + a d ) + bd a) Use AND and OR gates b) Use NAND gates 8
Boolean Postulates P1: X = 0 or X = 1 P2: 0 0 = 0 P3: 1 + 1 = 1 P4: 0 + 0 = 0 P5: 1 1 = 1 P6: 1 0 = 0 1 = 0 P7: 1 + 0 = 0 + 1 = 1 9
Boolean Laws -- 1 Commutative Law (a) A + B = B + A (b) A B = B A Associate Law (a) (A + B) + C = A + (B + C) (b) (A B) C = A (B C) Distributive Law (a) A (B + C) = A B + A C (b) A + (B C) = (A + B) (A + C) Identity Law (a) A + A = A (b) A A = A 10
Boolean Laws -- 2 Redundancy Law (a) A + A B = A (b) A (A + B) = A Null: (a) 0 + A = A (b) 0 A = 0 Complement: (a) A + A = 1 (b) AA = 0 11
From Function to Truth Table f(x, y, z) = x y + xy + xyz 12
From Function to Truth Table f(x, y, z) = x y + xy + xyz x y z f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1 13
From Function to Truth Table f(x, y, z) = x y + xy 14
From Function to Truth Table f(x, y, z) = x y + xy x y z f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 How about f(x, y, z) = x y? 15
The Karnaugh Map (K-map) K-map is a graphical approach to finding minimum SOP expressions (prime implicants) for function simplification. K-map is very useful for small design problems of 3-4 variables (up to 6 variables) Solutions for Problems of more that 6 variables can be found in Chapter 4, we will NOT cover them in this course. 16
Goals Given a function described by a truth table or logic function Draw the Karnaugh Map for the function. Use the information from a Karnaugh Map to determine the smallest sum-of-products (SOP) function. 17
Two-variable Karnaugh maps K-map is a graphical representation of a truth table. Two adjacent cells (horizontal or vertical) in the map differ by a change in one variable. The order of terms goes 00, 01, 11, 10. Note: NOT 00, 01, 10, 11. 18
Two-variable Karnaugh maps 19
Three-variable Karnaugh maps Wrong 20
The Karnaugh maps Product terms corresponding to the sum of two minterms appear as two adjacent 1 s on the map. 21
The Karnaugh maps Product terms corresponding to the sum of two minterms appear as two adjacent 1 s on the map. 22
Four-variable Karnaugh maps There are 16 cells in the 4-variable K-map. 23
Group of 4 1s on K-maps 24
Group of 8 1s on K-maps A D 25
Implicant An implicant is a rectangle of 1, 2, 4, 8,... (any power of 2) 1 s. That rectangle may not include any 0 s.
Implicant -- 2 The implicants of F are Minterms Groups of 2 Groups of 4 A B C D A CD CD A B CD BCD A BCD ACD ABC D B CD ABC D ABC ABCD ABD AB CD
Prime Implicant A prime implicant is an implicant that (from the point of view of the map) is not fully contained in any one other implicant. An essential prime implicant is a prime implicant that includes at least one 1 that is not included in any other prime implicant. prime implicant, but not essential prime implicant
Basic Rules of Karnaugh maps Anytime you have N variables, you will have 2 N possible combinations, and 2 N places in a truth table or K-Map. In a Karnaugh Map of any size, crossing a vertical or horizontal cell boundary is a change of only one variable -- no matter how many variables there are. Each single cell that contains a 1 represents a minterm in the function, and each minterm can be thought of as a "product" term with N variables. To combine variables, use groups of 2, 4, 8, etc. A group of 2 in an N-variable Karnaugh map will give you a "product" term with N-1 variables. A group of 4 will have N-2 variables, etc. You will never have a group of 3, a group of 5, etc. 29
Create K-map from Expressions f (x, y, z)= x yz + x yz + xy z + xy z + xyz
Simplification of Algebraic Expressions Example in Lecture 4: (1) x yz + x yz + xy z + xy z + xyz (2) x y + xy + xyz (3) x y + xy + xz (4) x y + xy + yz 31
Create K-map from Expressions f (A, B, C, D)= A B C D + A BC D + AB C D + ABC D + AB C D + A B CD + A BCD + AB CD + A B CD + ABCD + AB CD = m(0, 2, 3, 4,7, 8, 9, 10, 11, 13, 14)
Create K-map from Expressions f (A, B, C, D)= A B C D + A BC D + AB C D + ABC D + AB C D + A B CD + A BCD + AB CD + A B CD + ABCD + AB CD = m(0, 2, 3, 4,7, 8, 9, 10, 11, 13, 14)
Get expression from K-Map Practice 1 Write out the numerical expression of the following K-map 34
Get expression from K-Map Practice 2 Write out the numerical expressions of the following K-maps 35
Announcement: Review Chapter 3.1 HW2 is due Feb. 28. HW3 is out, due on Mar. 5. Next class (Chapter 3.2-3.5): Karnaugh Map Don t Cares Five and Six Variable K-Maps 36