You are on page 1of 12

School of Engineering

Department of Computer and Communications Engineering


Spring 2016 – 2017
CENG300 – Fundamentals of Digital Logic Design
Midterm
Date: April 10, 2017
Duration: 1 Hour 15 Minutes

Circle the name of your instructor


Dr. Lana Damaj Dr. Samir Omar Dr. Ali Kalakech
Dr. Hassan Nasser Dr. Mohamad Kanaan

Student Name: ____________________________ ID: ________________ Section: __________

There are four Questions in the booklet each has several parts, please answer all parts of the 4 questions to
the best of your ability.

Question Mark Weight


1 25
2 20
3 30
4 25
Total 100

Notes

1. This booklet contains (12) pages including this one. Make sure you have all these pages
2. Closed Book Examination
3. Programmable calculator not allowed
4. Do not take the staple out. The exam booklet must remain intact
5. The cheating penalty will be “F” in the exam
Good Luck

Page 1 of 12
Question 1: multiple choices (25 points) Select the one best correct answer and give your
justification when asked for. 2.5 points for each question, 1 point for the justification

1. How is (-1) stored in an 8-bits signed register?


a) 1111 1111 c) 1000 0000
b) 1000 0001 d) 0000 0000

Justify: ______________________________________________________________________

2. What type of implicants must necessarily be in the Minimum Sum of Products?


a) Prime implicants c) Essential prime implicants
b) Necessary prime implicants d) None of the above

3. What is the two input logic gate that gives 1 when the two inputs are equal and zero when the two
inputs are different?
a) NOR c) NAND
b) NXOR d) XOR

4. How many solutions does the K-Map to the left have?


Justify your answer by showing only the essential prime implicants 00 01 11 10
on the K-map. 00
a) 1 d) 4 01 1 1 1
b) 2 e) 5 11 1 1
c) 3 f) 6 10 1 1

5. We want to design a logic system that opens a door. The door opens when it receives 1 from the
logic system. The logic system is connected to two buttons. Each button gives 0 when it is pushed.
When both buttons are pushed together, the door opens. If you were to use only one logic gate to
build this system, which one would you use?
x y x (selected gate) y
a) AND c) XOR 0 0
b) OR d) NOR 0 1
1 0
1 1
Justify your answer by filling the truth table to the left using the selected
gate.

Page 2 of 12
6. A researcher is performing an experiment and has output voltages falling between -5 and 6 volts.
What is the size and type of the register he should use?
a) 3 bits signed register c) 3 bits unsigned register
b) 4 bits signed register d) 4 bits unsigned register

Justify: ____________________________________________________________

7. In a 6 bit register, which one is -5


a. 111011 c. 101111
b. 110111 d. 001001

Justify: ______________________________________________________________

8. Which one of the following is not a valid rule of Boolean algebra?


a. A + 1 = 1 c. A + 0 = A
b. A.A = 1 d. A + A = A

Justify: ______________________________________________________________

9. The following expression F(a,b,c) = a’b + c is made of how many minterms?


a. 2 d. 5
b. 3 e. 6
c. 4 f. 7

Justify: ______________________________________________________________

10. The output will be a Zero for any case when one or more inputs are zero in a(n)
a. OR gate c. AND gate
b. NOT gate d. NAND gate

Justify: ______________________________________________________________

Page 3 of 12
Question 2: Boolean algebra (20 points)

1- (10 points) Consider the following Boolean function


f = x2x3'x4 + x1x3x4 + x1x2'x4
a. Applying the consensus property to the first two terms (3 points)

b. Derive the simplest sum-of-products expression for this function (2 points)

c. Draw the circuit for the reduced function.


Only uncomplemented inputs are available (2 points)

2- Using Boolean algebra techniques, simplify this expression: (3 points)


f = xy + x(y + z) + y(y + z)

Page 4 of 12
3- (10 points) Consider the function
f=w’x’y + x’y’z’ + w’xy’z’ + x’y’z + w’y
a. Reduce f to 3 terms, 6 literals using algebraic manipulation (5 points)

b. Construct the KMAP of f (3 points) and prove the answer of part a (5 points)

Page 5 of 12
Question 3: K-Map and function implementation (30 points)

1- A circuit that controls a given digital system has three inputs: x1, x2, and x3. It has to recognize
three different conditions:
• Condition A is true if x3 is true and either x1 is true or x2 is false
• Condition B is true if x1 is true and either x2 or x3 is false
• Condition C is true if x2 is true and either x1 is true or x3 is false
The control circuit must produce an output of 1 if at least two of the conditions A, B, and C are
true. The objective is to design the simplest circuit that can be used for this purpose.

a. Write the expression of A (2 points)

b. Write the expression of B (1 point)

c. Write the expression of C (1 point)

d. Write the expression of f as a function of A, B and C (2 points)

f(A,B,C) =

e. Replace A, B and C in f by their respective expressions so that f become a function of x1,


x2, x3 (4 points)

Page 6 of 12
Page 7 of 12
2- Consider the following Boolean function:

G(a,b,c,d) = a’c’d’ + a’d + b’c + cd + ab’d’

a. Draw the K-map for this function (3 points)

b. Find all the prime implicants of G (3 points)

c. Find all the essential prime implicants of G (3 points)

d. Minimize the function G using the K-map (1 point)

Page 8 of 12
3- Design a control circuit for an irrigation system that reads the values from a humidity sensor, and
a temperature sensor. The humidity sensor gives 4 levels (0, 1, 2, and 3) where level 0 means that
the soil is totally dry and need watering while level 3 means that the soil is damped (wet). The
temperature sensor also provides 4 levels (0, 1, 2 and 3) where level 0 means low temperature and
level 3 means high temperature.

The control circuit should work according to the following rules:

- If humidity is level 0, the system should work regardless of the temperature reading
- If humidity is level 1 or higher, the system works only if the temperature level is higher
than the humidity level.

a. How many input and how many output bits are needed for this system? Justify your
answer (3 points)

b. Construct a truth table representing the system (4 points)

Page 9 of 12
c. Reduce the circuit using K-map

Page 10 of 12
Question 4: Binary, decimal and hexadecimal (25 points)

1- Perform the following addition in an 8 bit registers (3 points)

0 1 1 0 0 1 0 0
0 1 1 1 0 1 1 1

Do we have an overflow? _______ Why? _______________________

2- Perform the following subtraction of signed numbers in an 8 bit registers (4 points)

0 1 0 1 0 1 0 0
- 0 0 1 1 0 1 1 1

Do we have an overflow? ________ Why __________________________________

3- (6 points) Write these numbers in binary. Use 8 bit register:

-25

18

-32

Page 11 of 12
4- (6 points) Consider a 5 bit register

When working with unsigned numbers:

What is the highest decimal value that can be represented? _______________

What is the lowest decimal value that can be represented? _______________

When working with signed numbers:

What is the highest value that can be represented? ___________________

What is the lowest value that can be represented? ___________________

5- Convert from the indicated base to Binary. Detail your steps. (3 points each)

41010 = __________________

A0B02HEX = _________________________________________

Page 12 of 12

You might also like