Final 20
Final 20
Instructions:
Class :
ID :
Name :
1 aaaaaaaa/ 30
2 aaaaaaaa/ 30
3 aaaaaaaa/ 20
4 aaaaaaaa/ 40
5 aaaaaaaa/ 30
6 aaaaaaaa/ 30
Total aaaaaaaa/ 180
Final Page 1 of 16
1. Waveforms (30 points)
Determine the waveform of the output. No need to justify the answer.
Final Page 2 of 16
(c) Assume D0 = D1 = D3 = 0 and D2 = 1. (10 points)
Final Page 3 of 16
2. Mix of Problems (30 points)
Final Page 4 of 16
Mix of Problems cont.
Final Page 5 of 16
3. Absolute Value (20 points)
Design a digital block which computes the absolute value of 4-bit binary number under
two’s complement system. In this design, assume that only AND, OR, NOT gates are
available. More precisely, the input signal A has four bits A3 A2 A1 A0 and the output signal
B has four bits B3 B2 B1 B0 . If A is smaller than or equal to 0 (under two’s complement
system), than B = A. On the other hand, if A is greater than 0, than B = −A under
two’s complement system. I.e., B = −|A|. Note that A3 is the MSB and A0 is the LSB
of A.
Final Page 6 of 16
Absolute Value cont.
Final Page 7 of 16
4. Priority Encoder (40 points)
Design a 2-bit priority encoder which takes A0 , A1 , A2 , A3 as inputs, and outputs B0 , B1 , N .
A priority encoder is exactly the same with basic encoder. However it produces a binary
output corresponding to the highest number when there are more than two active inputs.
The additional output will be activated N = 1 if and only if A0 = A1 = A2 = A3 = 0.
For example, if A1 = A2 = 1 and A0 = A3 = 0, then B0 = 0, B1 = 1 and N = 0 which
corresponds to the highest active input A2 . Note that we do not care B0 and B1 when
A0 = A1 = A2 = A3 = 0. Further assume that only AND, OR, NOT gates are available.
(a) Reduce N to a minimum SOP form. You do not need to justify your answer (5
points)
(b) Construct a truth table of B0 and B1 . (5 points)
(c) Use a Karnaugh map to reduce B0 to a minimum SOP form. (10 points)
(d) Use the Quine-McClusckey method to reduce B1 to a minimum POS form. Note
that you have to merge maxterms (inputs result in 0 for the output). (10 points)
(e) Use two 2-bit priority encoders, construct a 3-bit priority encoder which takes
A0 , A1 , . . . , A7 as inputs and outputs B0 , B1 , B2 and N . You are allowed to use
basic gates (AND, OR, NOT) as well, but the number of additional gates should be
minimized. Fill the following diagram and justify your answer. (10 points)
Final Page 8 of 16
Priority Encoder cont-1.
Final Page 9 of 16
Priority Encoder cont-2.
Final Page 10 of 16
5. Moore Machine (30 points)
Design a 3-bit counter using JK flip-flops where the current state A = A2 A1 A0 and the
next state B = B2 B1 B0 have the following relation.
Final Page 11 of 16
Moore Machine cont-1.
Final Page 12 of 16
Moore Machine cont-2.
Final Page 13 of 16
6. Mealy Machine (30 points)
Design a 3-bit counter using T flip-flops where the current state A = A2 A1 A0 with input
X and the next state B = B2 B1 B0 have the following relation.
• If X = 0, it is an even counter 0, 2, 4, 6.
• If X = 1, it is an odd counter 1, 3, 5, 7.
• If A is an even number and X = 1, then B = A + 1.
• If A is an odd number and X = 0, then B = A + 1. If A = 7 and X = 0, then
B = 0.
Note that T flip-flop toggles the output Q = Q̄0 if T = 1 and maintains the output
Q = Q0 if T = 0 where Q0 is the previous output state.
Note that you are not allowed to use other flip-flops (such as JK flip-flop).
Final Page 14 of 16
Mealy Machine cont-1.
Final Page 15 of 16
Mealy Machine cont-2.
Final Page 16 of 16