Module 11-Design of Synchronous Sequential Counters and State Machines
Module 11-Design of Synchronous Sequential Counters and State Machines
A basic State counter uses one flip flop for each state variable or
count variable that is fed back to the inputs of the control logic.
There needs to be enough state variables to generate enough
combinations to complete the desired number of steps. Each flip
flop is parallel clocked or clocked by the same flip flop at the same
time. Outside of the clock, the only other external input that the
counter may have is a set or clear that is used to start the counter in
its reset or desired starting state.
Introduction to Digital Electronics – Module 11: Design of Sequential Counters and State Machines 2
The design of a basic state counter requires several tools. First you
must map out the desired count sequence using a “State Graph”. A
state graph has one circle for every possible state. If the counter
has three state variables, the state graph will have eight circle. A
four state variable design will start with a state graph that has
sixteen circles and so on.
The final set of columns contain the control variables or the inputs to the flip
flops or memory devices needed to force them to transition to the next
state. For “D” flip flops, the D inputs must be the same as the next state.
To make a state machine that uses D flip flops, the D inputs must have a
combinational logic circuit that will cause the correct next state to be present
on the D input for each present state.
The best way to understand how to design a state counter is to follow a step
by step procedure to design one. We will design a state counter that will
count up in even steps as 0 2 4 6 0 2, and so on.
Notice that the D control variables are exactly the same as the next state
variables. This is only true for the D flip flop. J-K flip flops must have the
right combinations of J and K inputs to make the flip flop transition from the
present state to the next state.
Here A, B, and C are the outputs of the flip flops which are fed back to the
Combinational logic circuits which create the next state inputs on the D
control variable inputs of the same flip flops. This is what makes the flip
flops transition to the correct next state.
If you are designing the state machine using programmable logic, there is no
need to simplify the combinational logic circuits because the programmable
logic device will have more than enough gates and inputs to cover the
unsimplified equations. If you are going to build the design using discrete
components, you might want to simplify the design using Karnaugh Maps.
Introduction to Digital Electronics – Module 11: Design of Sequential Counters and State Machines 4
J-K flip flop designs reduce much more than D flip flop designs because the
J-K flip flops have “don’t care” variables in their design equations. There
would be six control variables for each of the J’s and K’s for each flip flop,
but the control variable equations for each would reduce few or no gates.
There are no external input variables that will change the counter. It will
just continue to count the 0 2 4 6 0 . . . . sequence it was
designed to count without ever changing its order.
Introduction to Digital Electronics – Module 11: Design of Sequential Counters and State Machines 5
The best way to understand how to complete a state machine design with
external input variables is to design such a machine. Add to the earlier
design an input variable X. If X=0, the sequence is 0 2 4 6 0 as
before. If X = 1, make the sequence 1 3 5 7 1.
The design steps will be similar to the original design but now much include
the input variable X.
Even after simplifying the equations, the circuit is quite complicated. This is
a good candidate for a pal design.