CSE 140 Midterm I - Solution 1. Answer the following questions given the logic circuit below. (15 points) a. (5 points) How many CMOS transistors does the given (unsimplified) circuit have. b. (6 points) Derive the minimal Boolean equation for Y in SOP form by using a K-Map. c. (4 points) Draw the logic gate implementation of Y in part (B) using only 2-input NAND gates and INVERTERS. Solution : a. Total number of transistors in given circuit NAND gates = 2 x 4 = 8 Inverters = 2 x 2 = 4 OR gates = NOR gates + INVERTER = 3 x 6 = 18 Total = 8 + 4 +18 = 30 B. k-map
Simplification of output Y Y = A + AB + BC + C = A + A + B + B + C + C = A + B + C = ABC c. Logic circuits using only 2 input NAND gates.
2. (14 points) (A) (5 points) You are given a Boolean expression F = ABC D + AB CD + A BCD + A B C D. Determine the 2-input mystery gate (MG), so that the circuit below has the same Boolean expression as F. (B) (14 points) circuit above was shown to a talented engineer Steven for his expert advice. He fixed it up to produce a logic 1 at the output Y when: (a) A = 0 and D = 1 (b) A = 1, B = 1 and C = 1 (c) A = 1, B = 0, C = 1, D = 0 The circuit he designed will never get the input combination A = 1, C = 0 and D = 0. (i) (5 points) Fill out the K-Map for the circuit Steven designed (ii) (3 points) Identify ALL prime implicants (iii) (3 points) List the essential prime implicants (iv) (3 points) Write the minimum cover in SOP form Solution: (A) XOR
(B) (i) CD \ AB-> 00 01 11 10 00 0 0 X X 01 1 1 0 0 11 1 1 1 0 10 0 0 1 1 (i) A D, AD, BCD, ABC (ii) AD, A D (iii) A D + AD + BCD (OR) A D + AD + ABC 3. (12 Points): A) Prove the equivalence of following Boolean expressions using Venn diagram. Label each shaded area using numbering system shown above the equations. Label: 1 2 3 4 5 6 7 8 9 abc + a + b = abc + ab c + abc + ab c + a bc + a bc B) Confirm your results using Boolean algebra. Show each step for full credit. Solution: Venn diagram: The labeled Venn diagram for LHS and RHS is as follows: LHS:
RHS: Therefore, LHS and RHS are equivalent. Boolean Algebra: RHS = abc + ab c + abc + ab c + a bc + a bc = ac(b+b ) + ac (b + b ) + a b(c + c ) = ac + ac + a b = a(c + c ) + a b
= a + a b = a(1 + b) + a b = a + b (a + a ) = a + b LHS = abc + a + b = a + b Therefore, LHS and RHS are equivalent. 4. (14 points): Considering the following logic circuit, perform these tasks. (24 points) (A) Write down the equation f(a, B, C) that exactly matches the circuit. (B) Convert equation f(a, B, C) into canonical SOP (sum of products) form. (C) Specify the canonical POS form for equation f(a, B, C). (D) Specify the canonical SOP form for the inverted function f (A, B, C). (E) Minimize SOP form for f (A, B, C) and write the resulting boolean equation Solution: (A) f(a,b,c) = AB + AC + A C (B) AB = AB(C + C ) = ABC + ABC = m 7 + m 6 AC = AC (B + B ) = ABC + AB C = m 6 + m 4 A C = A C(B + B ) = A BC + A B C = m 3 + m 1 f(a, B, C) = m 7 + m 6 + m 6 + m 4 + m 3 + m 1 f(a, B, C) = Σ m(1, 3, 4, 6, 7) (C) f(a, B, C) = Π M(0, 2, 5) (D) f (A, B, C) = Σ m(0, 2, 5)
(E) Karnaugh map is used to minimize the function: Minimized function f in SOP form: f (A, B, C) = A C + AB C 5. (20 points): Consider the following function f(a, B, C, D ) = m (0, 6, 7, 11, 15) + d (5, 14) + A B D Answer the following questions based on the above function A) (4 points) Fill out the K-map for the given function B) (8 points) Write the minimum SOP expression C) (8 points) Draw the logic circuit of part (C) using INVERTERS and 2-input gates to ensure there is a minimum number of transistors. How many transistors does your logic circuit use? Solution: A) K-map Simplification of function f(a, B, C, D ) = m (0, 6, 7, 11, 15) + d (5, 14) + A B D = m (0, 6, 7, 11, 15) + d (5, 14) + A B D ( C + C) = m (0, 6, 7, 11, 15) + d (5, 14) + A B C D + A B C D = m (0, 1, 3, 6, 7, 11, 15) + d (5, 14)
B) SOP simplification f(a, B, C, D ) = A B C + C D + B C C) f(a, B, C, D ) = A B C + C (B + D ) = (A + B + C ) + C (B + D ) = (A + B + C ) + C (B + D ) = (A + B + C ). C (B + D )
Number of transistors 2 NAND = 8 transistors 3 OR= 18 transistors Total = 18 + 8 = 26 transistors 6. (20 points) Tom wants to design a circuit to help him decide if he should throw a party or not. There are four inputs he considers: does he have Soft drinks (S), Pizza (P), Chips (C ) and whether or not he has a work meeting (M) that night. When he has a meeting (M = 1), he doesn t need the help of the circuit as he doesn t want to miss the meeting (don t care condition), UNLESS A. He has Soft drinks and Chips B. He has Soft drinks, Pizza and Chips In both of these cases Tom would like to party (output Y set to 1 ) as he doesn t mind missing his meeting for the above mentioned food items. If he has no meeting scheduled (M = 0), he wants to throw a party if he has at least two out of the three food items (Soft drinks, Pizza, and Chips). A. (6 points) Fill out the truth table for the circuit. B. (4 points) Write the canonical SOP of function Y(S,P,C,M) using standard m() + DC() notation C. (8 points) Derive the minimal POS expression for Y using K-Map below.
D. (2 points) Write the canonical SOP of function MomHappy (S,P,C,M) using standard m() + DC() notation which is set to 1 if Tom is not throwing a party, else it is 0. Solution: A. S P C M Y 0 0 0 0 0 0 0 0 1 X 0 0 1 0 0 0 0 1 1 X 0 1 0 0 0 0 1 0 1 X 0 1 1 0 1 0 1 1 1 X 1 0 0 0 0 1 0 0 1 X 1 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 X 1 1 1 0 1 1 1 1 1 1 B. Y = m(6, 10, 11, 12, 14, 15) + DC(1, 3, 5, 7, 9, 13)
C. Y = (S+P)(S+C)(P+C) D. MomHappy = m(0, 1, 2, 3, 4, 5, 7, 8, 9, 13) + DC()