In this lecture you will learn techniques for analyzing sequential circuits. Sequential circuit analysis is useful when
Sequential circuit analysis is primarily about expressing the functionality of a sequential circuit in different forms. Each form provides a little more information or insight as to the functionality of the circuit. The 5 forms of a sequential circuit we will study in this lecture are:
We will also define the Mealy and Moore models for representing sequential circuits.
We will study sequential circuit analysis by way of an example. Assume you have been asked to determine what the following circuit does:
Figure 1.
The first step is to establish that it is in fact a sequential circuit. If it was a combinational circuit a truth table could be used to determine its functionality.
The circuit above is in fact a sequential circuit because it has memory elements (here Dtype flipflops) and feedback paths.
Step 1: Develop excitation equations
Excitation equations are Boolean equations that describe the input to the flipflops. The circuit uses Dtype flipflips so each flipflip has only one input.
D_{0} = Q_{0} XOR C
D_{1} = C'Q_{1} + Q_{0}CQ_{1}' + CQ_{1}Q_{0}'
Equation 1.
These equations describe the inputs to the flipflops in terms of the current circuit inputs and current circuit state.
Step 2: Develop next state equations
Next state equations use the excitation equations developed in step 1 and the flipflop characteristic equations to compute the next state of each flipflop.
This step is easy for this example because the circuit uses Dtype flipflops. The characteristic equation for a Dtype flipflop is:
Q_{next} = D
So, the next state equations are:
Q_{0next} = Q_{0} XOR C
Q_{1next} = C'Q_{1} + Q_{0}CQ_{1}' + CQ_{1}Q_{0}'
Equation 2.
As part of the next state equations we also provide the equation for the output:
Y = Q_{0}Q_{1}
Equation 3.
Step 3: Develop state table
This is the first step where you start to understand the functionality of the circuit.
Present State  Next State (Q_{1}Q_{0}) 
Outputs  
Q_{1} Q_{0}  C=0  C=1  
0 0  0 0  0 1  0 
0 1  0 1  1 0  0 
1 0  1 0  1 1  0 
1 1  1 1  0 0  1 
Table 1.
The present state of the circuit is defined by the state of the flipflops in the circuit. Next state is determined by the present state and current inputs (here C). In this circuit the outputs are completely a function of the current state. (The next example shows how to draw the state table for a sequential circuit where the outputs are a function of current state and current inputs.)
Looking at the state table you start to get an idea about the dynamic behavior of the circuit. From the state table it's easy to see that this circuit moves sequentially through the states while C=1.
Step 4: Develop state diagram
A state diagram shows graphically the state transitions:
Figure 2.
Each node represents a state. The state which the node represents is written inside of the node. Also, since the output Y is completely determined by the current state we can write the output value within each node. The arcs in the diagram represent inputs. Some arcs take the circuit to a new state and others leave the circuit in the same state.
With this representation it's very easy to see how the circuit transitions between states.
When doing sequential circuit analysis it is often helpful to distinguish between two different circuit models: Mealy and Moore.
Figure 3. Moore Model
Figure 4. Mealy Model
The Moore model represents a circuit where the outputs are a function of only the current state. A Mealy model represents a circuit where the outputs are a function of both the current state and the current inputs. Why is it helpful to make the distinction? How you draw the state table and the state diagram depends on what model the circuit follows. For example, if the circuit follows the Mealy model you can't show the output of the circuit within nodes because the output depends on the current input alsonot just the current state.
What model does our example above follow? It follows the Moore model because the output is a function only of the current state. This is reflected in the way we drew the state table and the state diagram.
In this second example we show how to perform sequential circuit analysis on a Mealytype circuit. Another noticeable difference is that the memory elements are JK flipflops. This will make the development of the state equations slightly more difficult.
Figure 5.
It is easy to see that this circuit is sequentialit has memory elements (JK flipflops) and feedback paths. It's also easy to see that it is a Mealy type circuit because the output Z is a function of the current state and the input X:
Z = Q_{1}Q_{2}'X
Step 1: Develop excitation equations
The excitation equations are a bit more complex because each flipflop has two inputs.
J_{1} = X'Q_{2}
K_{1} = X XOR Q_{2}
J_{2} = Q_{1} + X
K_{2} = Q_{1}
Equation 4.
Step 2: Develop next state equations
Remember that the next state equations are equations that compute the next state of the circuit given the current state and inputs. Since the next state of a flipflop is defined by it's characteristic equation we plug the excitation equations into the characteristic equation for the flipflop.
This step is more complicated because we are using JK flipflops.
The characteristic equation for a JK flipflop is:
Q_{next} = JQ' + K'Q
So, the next state equations are:
Q_{1next} = (X'Q_{2})Q_{1}' + (X XOR Q_{2})'Q_{1}
Q_{2next} = (Q_{1} + X)Q_{2}' + (Q_{1})'Q_{2}
Equation 5.
And the output of this circuit is:
Z = Q_{1}Q_{2}'X
Step 3: Develop state table
Because the output of this circuit is a function of the current state and input the state table has to show the output as part of the next state.
Present State  Next State (Q_{1}Q_{2})/Output 

Q_{1} Q_{2}  X=0  X=1 
0 0  00 / 0  01 / 0 
0 1  11 / 0  01 / 0 
1 0  11 / 0  01 / 1 
1 1  00 / 0  10 / 0 
Table 2.
The state table has an entry or row for every combination of state values (not all may be used be we can't determine this until the state table is filled out).
The values for next state (Q_{1}Q_{2}) are determined from the next state equations developed in step 2. The output value is for the current state and current inputnot for the next state. If you have any confusion about how to calculate the output value, refer back to the original circuit. Looking at the circuit implementation you can see that the output is a function of the current state and current input.
The state table give more information about the circuit, but it is still hard to determine what the circuit is doing.
Step 4: Develop state diagram
It's easier to understand the functionality of this circuit by looking at the state diagram:
Figure 6. Sequence detector for the sequence 1011.
The state diagram is slightly different because our circuit follows the Mealy modelthe output is a function of the current state and current inputs.
Like the state diagram for the Moore circuit in the first example, the state which the node represents is written inside of the node. Unlike the diagram in the first example the output is show on the arcs. Here is how to interpret the label on the arc leaving a node:
Figure 7.
If the current state of the circuit is X and the current input is 0 the output should be a 1. Note, that this output may not be around for long because as soon as the circuit does move to the next state (probably at the next hightolow or lowtohigh transition on the clock) there will be another arc that determines what the output should be.