Download Xilinx ABEL User Guide

Transcript
Chapter.book : ch2.doc
7 Tue Sep 17 12:21:10 1996
State Machine Design Methodology
One-Hot Encoding
One-hot encoding takes an approach that is opposite to that of binary
encoding. In one-hot encoding, an individual state register is
dedicated to one state. Only one flip-flop is active, or hot, at any one
time. If the example discussed earlier in this chapter is implemented
as a one-hot encoded state machine, it uses five state registers.
There are two ways that one-hot encoding can significantly reduce
the amount of combinatorial logic used to implement a state
machine. As noted earlier, highly encoded designs tend to require
many high fanin logic functions to interpret the inputs. One-hot
encoding simplifies this interpretation process, because each state has
its own register, or flip-flop. As a result, the state machine is already
“decoded,” so the state of the machine is determined simply by
finding out which flip-flop is active. One-hot encoding reduces the
width of the combinatorial logic and, as a result, the state machine
requires fewer levels of logic between registers, reducing its
complexity and increasing its speed.
Although one-hot encoding can be used for EPLDs and FPGAs, it is
better suited to FPGAs.
See the “Accelerate FPGA Macros with One-Hot Approach”
appendix of this manual for a detailed description of one-hot
encoding and its applications.
One-Hot Encoding in Xilinx FPGA Architecture
One-hot encoding is well-suited to Xilinx FPGAs because the Xilinx
architecture is rich in registers, while each configurable logic block
(CLB) has a limited number of inputs. As a result, state machine
designs that require few registers, many combinatorial elements, and
large fanin do not take full advantage of these resources. In general, a
one-hot state machine implemented in a Xilinx FPGA minimizes both
the number of CLBs and the levels of logic used. As a result, the
circuit can run much faster than it would using binary encoding.
Limitations
In some cases, the one-hot method may not be the best encoding
technique for a state machine implemented in a Xilinx device. For
example, if the number of states is small, the speed advantages of
Xilinx ABEL User Guide
2-7