Midterm Solution
Midterm Solution
You have 60 minutes to take this 30 point quiz. Please attach the question paper to your
answer sheet.
RE
1. (10 points) Consider a latch and a positive edge-triggered flip-flop connected as shown
below:
z
x D Q D Q y
HO
clock E CLK
Suppose, we apply the following signals to wires clock and x, assuming y and z are zero
initially.
clock
LA
x
z
y
0 1 2 3 4 5 6 7 8 t(µsec)
(a) Draw the output waveform that will appear on wires z and y. Assume both the latch
and the flip-flop has a delay of 0.1µsec (the output appears 0.1µsec after the input is
applied). Write down the time corresponding to all transitions on t-axis for both z and
y. (6) [CLO2]
T
reg y, z;
UE
always@(posedge clk)
begin
if(reset) y = 0;
else y = z;
end
always@(x, E)
begin
if(E) z = x;
end
2. (10 points) Design a Moore type finite state machine for a sequential system which has
one input and one output. For a given clock cycle, you can either apply A, B or C at the
input of this machine and this machine will provide you one output either Y or Z based on the
RE
following description: Output will be Y when the input sequence has even number of A’s and
odd number of B’s. Otherwise output will be Z.
Solution:
3.
HO
(10 points) Consider the following K-map.
AB|CD
00
01
11
00
1
01
1
11
1
1
10
LA
10 1 1
(a) Write all prime, essential prime implicants of the K-map. Write the reduced equation.
(6)
Solution: Prime Implicants: B̄ C̄ D̄, ABD, BCD, AB̄ D̄. All prime implicants are essen-
tial.
(b) Is there any static hazard present in the reduced hardware? Which one is it? For which
transition do you observe the static hazard? (4)
T
4. (10 points) State transition table of a finite state machine is given as:
UE
(a) Draw state transition graph from above state transition table. (03)
(b) Reduce the number of states in your state transition graph. (05)
Solution:
RE
HOPresent State
A
B
Next State
X=0
B
A
X=1
G
D
Output
X=0
0
1
X=1
1
1
LA
C F G 0 1
D H A 0 0
E G C 0 0
F C D 1 1
G G E 0 0
H G D 0 0
T
UE
UE
T
LA
HO
RE