|
by Ingo Cyliax
Start ý An
ASM Example ý Input and Output Signals
ý Implementation ý One-Hot
Encoding ý Synthesize ý Initializing
ý Until Next Time ý Sources
and PDF
IMPLEMENTATION
At this point I have tied down the input
and output signals, but havenýt decided how to implement the actual
state machine. Traditionally, there are several ways you can implement
state machines. State machines are usually like the one shown in Figure
3. There is a state variable, which is implemented as registers. There
is a next function generator, which will look at the current state
of the machine, evaluate some inputs, and compute what the next state
should be. And, there is an output function generator, which computes
the output based on the current state and input signals.
|
|
| Figure 3ýA typical state machine
has a state variable register and logic or look-up tables that
compute the next state as well as outputs based on the current
state and inputs from the outside. |
The function generators can be look-up
tables, logic gates to generate the output function and next state
function. The state variable contains some kind of encoding of the
states in the state machine. One type of encoding would be to assign
a sequential binary number to all of the states in the machine and
use the binary number as the representation in the state variable
register. The advantage of doing this is that you can represent a
large number of states with log2(n) register bits. The disadvantage
is that, for some state transitions, you may have a large number of
bits changing in the state variable register.
Generally, you would encode the states
in such a way that only a few bits change in the register. This reduces
power consumption and makes the next state equations smaller because,
on average, only a few bits are affected by a state change. Encoding
methods such as gray codes are a favorite for these types of state
machines.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ýCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |