Sequential Circuit Analysis Review: Flip-Flop Variations
Sequential Circuit Analysis Review: Flip-Flop Variations
Last week we started talking about latches and flip-flops, which are
basic one-bit memory units.
Today well talk about sequential circuit analysis and design.
First, well see how to analyze and describe sequential circuits.
State tables show the inputs, outputs, and flip-flop state changes
for sequential circuits.
State diagrams are an alternative but equivalent way of showing the
same information.
Inputs
Combinational
circuit
Outputs
Q(t+1)
Operation
0
1
0
1
Reset
Set
Q(t+1)
Operation
0
0
1
1
0
1
0
1
Q(t)
0
1
Q(t)
No change
Reset
Set
Complement
Q(t+1)
Operation
0
1
Reset
Set
Q(t+1)
Operation
0
1
0
1
Reset
Set
Q(t+1)
Operation
0
0
1
1
0
1
0
1
Q(t)
0
1
Q(t)
No change
Reset
Set
Complement
Q(t+1)
Operation
0
1
Q(t)
Q(t)
No change
Complement
Q(t+1)
Operation
0
0
1
1
0
1
0
1
Q(t)
0
1
Q(t)
No change
Reset
Set
Complement
Q(t+1)
Operation
Q(t+1)
Operation
Q(t)
Q(t)
No change
Complement
0
1
Q(t)
Q(t)
No change
Complement
Qnext
0
1
1
x
0
1
No change
No change
Qcurrent
2
Q(t+1) = D
0
1
Q(t+1) = D
No change
No change
0 (reset)
1 (set)
Qcurrent
We can also write characteristic equations, where the next state Q(t+1)
is defined in terms of the current state Q(t) and inputs.
We can also write characteristic equations, where the next state Q(t+1)
is defined in terms of the current state Q(t) and inputs.
0
1
Qnext
x
0
1
0
1
x
0
0
1
1
0
1
1
1
1
Memory
(2)
(3)
(4)
(1)
(2)
(3)
(4)
Similarly, the values of J, K and Q at the second positive clock edge can
be used to find the value of Q during the third clock cycle.
When we do this, Q(2) is now referred to as the present state, and
Q(3) is now the next state.
One final point to repeat: the flip-flop outputs are affected only by the
input values at the positive edge.
In the diagram below, K changes rapidly between the second and
third positive edges.
But its only the input values at the third clock edge (K=1, and J=0
and Q=1) that affect the next state, so here Q changes to 0.
This is a fairly simple timing model. In real life there are setup times
and hold times to worry about as well, to account for internal and
external delays.
K
Q
October 20, 2003
Summary
X
Inputs
Z
Combinational
circuit
Outputs
Q0
Memory Q1
For a combinational circuit we could find a truth table, which shows how
the outputs are related to the inputs.
A state table is the sequential analog of a truth table. It shows inputs
and current states on the left, and outputs and next states on the right.
For a sequential circuit, the outputs are dependent upon not only the
inputs, but also the current state of the flip-flops.
In addition to finding outputs, we also need to find the state of the
flip-flops on the next clock cycle.
Present State
Q1
Q0
0
0
0
0
1
1
1
1
October 20, 2003
10
11
0
0
1
1
0
0
1
1
Inputs
X
Next State
Q1
Q0
Outputs
Z
0
1
0
1
0
1
0
1
Sequential circuit analysis
12
Step 1:
Find Boolean expressions for the flip-flop inputs.
I.e. How do the inputs (say, J & K) to the flipflops
depend on the current state and input
Z = Q1Q0X
Output at the current time
Present State
Q1
Q0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
Inputs
X
Finding the next states is harder. To do this, we have to figure out how
the flip-flops are changing.
Next State
Q1
Q0
Step 2:
Use these expressions to find the actual flip-flop input values for
each possible combination of present states and inputs.
I.e. Fill in the state table (with new intermediate columns)
Outputs
Z
0
1
0
1
0
1
0
1
0
0
0
0
0
0
0
1
Step 3:
Use flip-flop characteristic tables or equations to find the next
states, based on the flip-flop input values and the present states.
13
With these equations, we can make a table showing J1, K 1, J 0 and K 0 for
the different combinations of present state Q 1Q0 and input X.
J1 = X Q0
K1 = X + Q 0
J1 = X Q0
K1 = X + Q 0
J0 = X + Q 1
K0 = X
Present State
Q1
Q0
0
0
0
0
1
1
1
1
15
0
0
1
1
0
0
1
1
J1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
1
0
Flip-flop Inputs
K1
J0
0
1
1
1
0
1
1
1
0
1
0
1
1
1
1
1
K0
1
0
1
0
1
0
1
0
16
Finally, here are the next states for Q 1 and Q 0, using these equations:
Q1(t+1) = K 1Q1(t) + J 1Q1(t)
Q0(t+1) = K 0Q0(t) + J 0Q0(t)
Present State
Q1
Q0
Inputs
X
Step 3 concluded
J0 = X + Q 1
K0 = X
14
Q(t+1)
Operation
0
1
0
1
Q(t)
0
1
Q(t)
No change
Reset
Set
Complement
0
0
0
0
1
1
1
1
17
0
0
1
1
0
0
1
1
Inputs
X
J1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
1
0
FF Inputs
K1
J0
0
1
1
1
0
1
1
1
0
1
0
1
1
1
1
1
K0
Next State
Q1
Q0
1
0
1
0
1
0
1
0
0
0
1
0
1
0
0
0
0
1
0
1
1
1
0
1
18
State diagrams
We can also represent the state table graphically with a state diagram.
A diagram corresponding to our example state table is shown below.
input
Present State
Q1
Q0
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
Inputs
X
J1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
1
0
FF Inputs
K1
J0
0
1
1
1
0
1
1
1
0
1
0
1
1
1
1
1
K0
1
0
1
0
1
0
1
0
Next State
Q1
Q0
0
0
1
0
1
0
0
0
Outputs
Z
0
1
0
1
1
1
0
1
0
0
0
0
0
0
0
1
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
1
0
1
0
0
0
0
1
0
1
1
1
0
1
0
0
0
0
0
0
0
1
output
0/0
00
0/0
11
1/0
1/0
1/1
0/0
01
1/0
0/0
10
state
October 20, 2003
19
In our example,
We have two flip-flops, and thus four states or nodes.
There is one input, so each node has two outgoing arrows.
0
0
0
0
1
1
1
1
0
1
0
1
0
1
0
1
0
0
1
0
1
0
0
0
0
1
0
1
1
1
0
1
0
0
0
0
0
0
0
1
0/0
00
0/0
11
1/0
1/0
1/1
0/0
01
1/0
0/0
10
21
20
22
Sequence recognizers
23
Here, one input and one output bit appear every clock cycle.
This requires a sequential circuit because the circuit has to remember
the inputs from previous clock cycles, in order to determine whether or
not a match was found.
24
1/0
0/0
0/0
State
Meaning
A
B
C
D
25