Tut 09 Qns
Tut 09 Qns
Discussion Questions:
D1. The state table on the right describes the state transition of a circuit
x
with 4 states A, B, C and D, an input x, and an output z. For example,
0 1
if the circuit is in state A and its input x is 0, then it moves into state C
A C/0 A/1
and generates the output 0 for z.
B D/1 B/0
(a) Complete the state diagram below. The label of the arc indicates C B/1 D/0
input/output, hence 1/1 means x=1 and z=1. D C/0 D/0
x/z
1/1
A
B C
(b) Assuming that the circuit starts in state A, find the output sequence and state sequence for the
input sequence x = 100010 (read from left to right). (x = 100010 means that initially x is 1, then
in the next clock x is 0, and so on.)
D2. Match the following state diagrams to the 4 flip-flops: JK flip-flop, D flip-flop, RS flip-flop, and T flip-
flop. Don’t-care value is indicated by “x”.
(a) (b)
1 10
0 0 1 1 0x 0 1 x0
0 01
(c) (d)
1 1x
0 0 1 0 0x 0 1 x0
1 x1
T Q
A
Clk
Q'
p
D Q B
Clk
Q'
Clock
(a) Complete the state table and hence draw the state diagram.
(b) Assuming that the circuit is initially at state 0, what is the final state and the outputs generated
after 3 clock cycles?
A state is called a sink if once the circuit enters this state, it never moves out of that state.
(c) How many sinks are there for this circuit?
(d) Which is likely to be an unused state in this circuit?
/p
Present state Output Flip-flop inputs Next state 0 1
A B p TA DB A+ B+
0 0
0 1
1 0
1 1 3 2
State 3 is unused. Can you complete the following state diagram with the unused state?
0
0 0 3
1 1
1
2 1
0
A circuit is self-correcting if for some reason the circuit enters into any unused (invalid) state, it is
able to transit to a valid state after a finite number of transitions. Is your circuit self-correcting, and
why?
1 3 5 7 9
6 4 2 15 13 11
The states are represented by 4-bit values ABCD. Implement the sequential circuit using a D flip-flop
for A, T flip-flops for B and C, and a JK flip-flop for D.
(a) Write out the simplified SOP expressions for all the flip-flop inputs.
(b) Implement your circuit according to your simplified SOP expressions obtained in part (a).
Complete the given state diagram, by indicating the next state for each of the five unused states.
0 8 10 12 14
1 3 5 7 9
6 4 2 15 13 11
4. Pokemone Theme Park offers locker rental to its visitors. Visitors may purchase two types of token:
Pokemoney $1 (P$1) and Pokemoney $2 (P$2). A locker’s rental costs P$3. When a visitor deposits
P$3 into the locker’s token slot, its door will open.
Design a sequential circuit with states AB for the locker’s door using D flip-flops. The circuit consists
of 4 states representing the amount a visitor has deposited: 0, 1, 2 and 3 (or, in binary, AB = 00, 01,
10 and 11). The visitor can deposit only one token at a time. When the circuit reaches the final state
3, it remains in state 3 even if the visitor continues to put tokens into the slot. When the circuit is in
state 2 and the visitor deposits a P$2 token, the circuit goes into state 3.
The partial state diagram is shown below. The inputs x and y represent the P$1 and P$2 tokens
respectively. The label on each arrow represents xy.
(a) Draw and write the missing arrows and labels.
00 00 00
10
00 01 10 11
(b) Write the simplified SOP expressions for the flip-flop inputs DA and DB.