Midterm

Page 1

Ministry of Higher Education Zagazig Higher Institute of Engineering & Technology COMPUTER ENGINEERING MIDTERM EXAM#2 : 27,August 2016

Exam Solution Q1. For the following function, f (x, y, z) = ∑ m (3, 4, 6, 7) a) Show a truth table. b) Find a sum of products expression for f (not necessarily minimum). c) Find a product of sums expression for f (not necessarily minimum). d) Minimize the answer to either part b or part c (2 terms, 4 literals). Answer a) x y z f b) f = x’ y z + x y’ z’ + x y z’ + x y z 0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 0 0 1 1 0 1 1

c) f’ = x’ y’ z’ + x’ y’ z + x’ y z’ + x y’ z f = (x + y + z) (x + y + z’) (x + y’ + z) (x’ + y + z’) d) f = y z (x’ + x) + x z’ (y’ + y) = y z + x z’ f’ = x’ z’ (y’ + y) + y’ z (x’ + x) = x’ z’ + y’ z f = (x + z) (y + z’)

Q2. a. The following are a minimum sum of product expression and a minimum product of sums expression for a function, f. Assume all inputs are available both uncomplemented and complemented. f = a' b' + b d + c' d = (b' + d) (a' + d) (a' + b + c') a) Show a two-level NAND gate implementation. b) Show a two-level NOR gate implementation. Answer : a' b' b' d b a' d f d

c' d

a)

a' b c'

b)

b. Reduce each of the following expression to a minimum sum of products. Show each step.


a)

g = w y' + w x y + w y z + w' x y + w x y'

Answer : g = w y' + w x y + w y z + w' x y + w x y' = w y’ + w x + w y z = w y’ + w x + w z

(3 terms, 7 literals)

(3 terms, 6 literals)

Q3. a. Convert the decimal number 311 to binary. Show your work. Answer : 311/2 = 155 rem 1 1 155/2 = 77 rem 1 11 77/2 = 38 rem 1 111 38/2 = 19 rem 0 0111 19/2 = 9 rem 1 10111 9 = 1001 100110111 b. Show the decimal equivalent of each of the numbers if they are interpeted as (six answers) 0110 0111 1001 0101 i) Unsigned binary ii) Signed binary iii) BCD (8421 code) Answer : 0110 0111 1001 0101 i) Unsigned binary 103 149 ii) Signed binary

iii) BCD (8421 code)

+103

Magnitude: 01101011 -107 67

95

c. Add the two pairs of positive binary numbers. (Be sure to show the carry as you add.) 01011 01010 10110 01001 Show both operands and the result of each addition in decimal as well as binary, indicating when there is overflow. Answer : 1111 1000 01011 11 01010 10 10110 22 01001 9 1 00001 1 0 10011 19 overflow Q4. a. Reduce the expression below (using the algebraic properties) to a sum of products expression with 3 terms and 5 literals. Show each step.

2


x' y' z' + x' y' z + x' y z + x y' z + x y z + x y z Answer : x' y' z' + x' y' z + x' y z + x y' z + x y z + x y z' = x' y' + x' y z + x y' z + x y = x' (y' + y z) + x (y + y' z) = x' y' + x' z + x y + x z = z + x' y' + x y or = z (x' y' + x' y + x y' + x z) + x' y' z' + x y z' = z + x' y' z' + x y z' = z + z' (x' y' + x y) = z + x' y' + x y b. For the following truth table x 0 0 0 0 1 1 1 1

y 0 0 1 1 0 0 1 1

z 0 1 0 1 0 1 0 1

f 1 0 1 1 0 0 0 1

i) Write a sum of minterms function in numeric form (for example, ∑ m (0, ...) ii) Write a sum of minterms function in algebraic form (for example, x' y + ...) iii) Find a minimum sum of products expression (2 terms, 4 literals) Answer : i.

f (x, y, z) = ∑ m (0, 2, 3, 7)

ii. f = x' y' z' + x' y z' + x' y z + x y z iii. f = x' z' (y' + y) + y z (x' + x) = x' z' + y z Good Luck

Dr. Mohamed


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.