ALTERA推荐状态机编码方式.pdf
文本预览下载声明
Application Brief 131 State Machine Encoding
State Machine Encoding
May 1994, ver. 1 Application Brief 131
Summary Each state of a state machine can be represented with a unique pattern of
high (1) and low (0) register output signals, a process called “encoding.”
The two primary encoding methods are binary and one-hot encoding. This
application brief describes both methods and discusses how to select the
encoding scheme that best suits your design, so that you can ensure
efficient performance and resource usage.
Binary The relationship between the number of state bits (B) and number of states
(S) in a binary-encoded state machine is represented by the following
Encoding equation:
B = log2 (S)
With this formula, you can easily determine the minimum number of state
bits required for a binary-encoded state machine. For example, to implement
a 4-state state machine with a binary encoding scheme, you can use two
flipflops (i.e., state bits) to uniquely define the four states as follows:
state1 = 00
state2 = 01
state3 = 10
state4 = 11
This example implements the state machine with a left-to-right sequential
binary encoding. You can also use a Gray co
显示全部