SOLUTIONS

13 downloads 874 Views 121KB Size Report
ENEE 244 - Digital Logic Design. SPRING SEMESTER 1999. MOCK-TEST 1 ( SOLUTIONS) /MARCH 8, 1999. CLOSED BOOKS, CLOSED NOTES, AND NO ...
ENEE 244 - Digital Logic Design SPRING SEMESTER 1999 MOCK-TEST 1 (SOLUTIONS) /MARCH 8, 1999 CLOSED BOOKS, CLOSED NOTES, AND NO CALCULATORS Exam Period: 75 Minutes Instructions: 1. Points for each problem’s are indicated right after the problem number. The maximum score is 120 points. 2. Use the space provided below each problem. Should you need more space, please ask the proctor. 3. Write your name and student Id. No. on the cover sheet. 4. Promptly hand in your exam to the proctor when (s)he declares that the exam is over.

Name: Student ID:

Problem 1: (20 points.) Carry out the following conversions (a) (1001 0110 0111)BCD = (967)10 = (11 × 122 + 6 × 12 + 7)8 = (11 × 144 + 74 + 7) = (1604 + 74 + 7)8 = (1707)8 (b) (77755588)9 = (11 × (6 + 3)3 ((6 + 3)4 + (6 + 3)3 + (6 + 3)2 ) + 5 × ((6 + 3)4 + (6 + 3)3 + (6 + 3)2 ) + 12 × 14)6 = (11 × (3 × 63 + 2 × 62 + 6 + 3)(5 × 64 + 2 × 62 + 6 + 3 + 3 × 63 + 2 × 62 + 6 + 3 + 2 × 62 +6+3)+5×(5×64 +2×62 +6+3+3×63 +2×62 +6+3+2×62 +6+3)+12×14)6 = (11×(3×63 +2×62 +6+3)(5×64 +4×63 +4×6+3)+5×(5×64 +4×63 +4×6+3)+ 12 × 14)6 = (11 × 3211 × 54043 + 5 × 54043 + 212)6 = (3422111513 + 442343 + 212)6 = 3422554512. Problem 2: (20 points.) Carry out the 2’s complement additions below, give the algebraic value of the result in decimal after each addition, and indicate if there is an overflow. (a) (111101110 + 111011101)2 = (111001011)2 = (−53)10 . No overflow since the operands and result are all negative. (b) (101100001 + 111110111)2 = (101011000)2 = (−168)10 . No overflow since both the operands and result are all negative. Problem 3: (20 points.) (a) Convert the following logic expression into a sum-of-products form, and specify the minterms of the function it represents. (a+b+cd)(b0 +c+d)+d0 e(a+b0 ) = ab0 +ac+ad+bc+bd+b0 cd+cd+cd+ad0 e+b0 d0 e = ab0 + ac + ad + bc + bd + cd + ad0 e + b0 d0 e. The corresponding function has 23 minterms which are: ab0 c0 d0 e0 , ab0 c0 d0 e, ab0 c0 de0 , ab0 c0 de, ab0 cd0 e0 , ab0 cd0 e, ab0 cde0 , ab0 cde, abc0 de0 , abcde0 , abcd0 e0 , abc0 de, abcde, abcd0 e, a0 bc0 de0 , a0 bcde0 , a0 bcd0 e0 , a0 bc0 de, a0 bcde, a0 bcd0 e, a0 b0 cde0 , a0 b0 c0 d0 e, a0 b0 cde (b) Convert the following expression into a product-of-sums form, and specify the maxterms of the function it represents. ab0 + a0 c0 d + d0 e(a + b0 ) = (a + a0 )(a + c0 )(a + d)(a0 + b0 )(b0 + c0 )(b0 + d) + d0 e(a + b0 ) = (a + c0 + d0 )(a + c0 + e)(a + b0 + c0 )(a + d + d0 )(a + d + e)(a + b0 + d) (a0 + b0 + d0 )(a0 + b0 + e)(a0 + b0 + a + b0 )(b0 + c0 + d0 )(b0 + c0 + e)(a + b0 + c0 )(b0 + d + d0 )(b0 + d + e)(a + b0 + d) = (a + c0 + d0 )(a + c0 + e)(a + b0 + c0 )(a0 + b + d0 )(a0 + b0 + e)(b0 + c0 + d0 ) (a + d + e)(a + b0 + d)(b0 + c0 + e)(b0 + d + e)(a + b0 + d)

The corresponding maxterms of the function can be obtained by extending each sum term, and eliminating the duplicate terms. For example, the first term leads to the maxterms: (a + c0 + d0 + b0 + e0 ), (a + c0 + d0 + b0 + e), (a + c0 + d0 + b + e0 ), (a + c0 + d0 + b + e) Other terms can be computed the same way. Problem 4: (20 points.) Consider a logic circuit with four inputs, a, b, c, d. The output of the circuit is to produce 0 if and only if the sum of the bits entered through the four inputs is either less than 4 or greater than 12. (a) Write down the truth table for Y. abcd ---0000 0001 0010 0011 1000 1001 1001 1010 1011 1100 1101 1110 1111

Y(a,b,c,d) -----------0 0 0 0 0 0 0 0 0 0 0 0 1

(b) Give a logic diagram for this circuit.

a b c d

y

Problem 5: (30 points.) Let Y (a, b, c, d, e, f, g) = a + (bc + (de + f 0 ))g (a) Compute the complement of Y using the DeMorgan’s law. Y 0 (a, b, c, d, e, f, g) = (a + (bc + (de + f 0 ))g)0 = a0 ((bc + (de + f 0 ))g)0 = a0 ((bc + (de + f 0 ))0 + g 0 ) = a0 ((bc)0 (de + f 0 )0 + g 0 ) = a0 ((b0 + c0 )(de)0 f 0 + g 0 ) = a0 ((b0 + c0 )(d0 + e0 )f 0 + g 0 ) (b) Show a logic circuit for Y using only NOR gates. a b’ c’

Y(a,b,c,d,e,f,g) = a+(bc+(de+f'))g

d’ e’ f’ g’

Problem 6: (20 points.) A switching function is called a symmetric function if its truth value does not change under any permutation of its variables. For example, if f is a symmetric function of three variables, then f (a, b, c) = f (a, c, b) = f (b, a, c) = f (b, c, a) = f (c, a, b) = f (c, b, a). (a) Give four symmetric functions of three variables. f (a, b, c) = 0; f (a, b, c) = 1; f (a, b, c) = abc; f (a, b, c) = a + b + c; (b) Is it true that a 3-variable function that evaluates to 1 when and only when two of its variables are 1 is symmetric? Explain. Yes. That’s because when a, b, and c are permuted the function will still be 1 when and only when two of its variables are 1, and hence its truth values should remain the same, making it a symmetric function.