|
by Ingo Cyliax
Start ı An
ASM Example ı Input and Output Signals
ı Implementation ı One-Hot
Encoding ı Synthesize ı Initializing
ı Until Next Time ı Sources
and PDF
ONE-HOT ENCODING
Taken to the extreme, you can devise
an encoding scheme that has one bit per state. This type of encoding
is called one-hot because only one state variable bit is set, or "hot,"
for each state. The benefit is that the next state generation function
is simple. Also, because only two bits change per transition, power
consumption is small. The drawback is that it takes a lot of register
bits, one per state. However, all of these are a real advantage in
FPGAs, because FPGAs are register rich.
Typically, there is a register after
each LUT. For many state machines, the next state generator for a
state bit will fit in a single LUT. Also, because next state functions
tend to be local in scope, the routing between state variables is
minimal when expressed as one-hot. For most state machines, one-hot
is the way to go in FPGAs.
Also, one-hots are easy to implement
in schematics. You can almost see the state machine representation
jump out at you because each state has its own flip-flop. So, letıs
check out how to implement the machine in a one-hot encoding.
Figure 4 shows the finished ASM. It is
much like the ASM in Figure 3, but I have added the state encoding
in its proper place, above and to the right of the state box. There
are two state variables, but only one can be on at a time. However,
a binary encoded state machine could get away with a single register
because itıs enough to hold two states.
|
|
| Figure 4ıIn this ASM, I have
assigned the actual state encoding as the top right of each
state box. Iım using one-hot encodeing so there are two state
variables, and only one of them can be on at any given time. |
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. |