首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

哪位能解释一下几种状态机设计时的编码方法吗?

哪位能解释一下几种状态机设计时的编码方法吗?

请解释一下状态机的以下几种编码方式的概念和优缺点:one hot 、gray 、sequential
假设有S0,S1,S2三个状态。
one hot 编码:
s0=001
s1=010
s2=100
gray 码:
s0=000
s1=001
s2=011

sequential:
s0=000
s1=001
s2=010
我不是高手
FPGA里面ONEHOT  的效率应该最高把,
??!!
住在水里说了一半  资源占有也很多嘛
One-Hot
One-hot encoding is the default encoding scheme. Its principle is to associate one code bit and also one flip-flop to each state. At a given clock cycle during operation, one and only one bit of the state variable is asserted. Only two bits toggle during a transition between two states. One-hot encoding is very appropriate with most FPGA targets where a large number of flip-flops are available. It is also a good alternative when trying to optimize speed or to reduce power dissipation.

Gray
Gray encoding guarantees that only one bit switches between two consecutive states. It is appropriate for controllers exhibiting long paths without branching. In addition, this coding technique minimizes hazards and glitches. Very good results can be obtained when implementing the state register with T

Compact
Compact encoding consists of minimizing the number of bits in the state variables and flip-flops. This technique is based on hypercube immersion. Compact encoding is appropriate when trying to optimize area.
                                               

Johnson
Like Gray, Johnson encoding shows benefits with state machines containing long paths with no branching.
Actual                                                       

Sequential
Sequential encoding consists of identifying long paths and applying successive radix two codes to the states on these paths. Next state equations are minimized.
Actual                                                       

Speed1
Speed1 encoding is oriented for speed optimization. The number of bits for a state register depends on the particular FSM, but generally it is greater than the number of FSM states.
返回列表