- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
有限状态机(ASM)(FSM)
Chapter 4 DESIGN FOR FINITE STATE MACHINES(FSM)(OR ASM) Sequential circuits are also called finite state machines (FSMs), which is a more formal name that is often found in technical literature. The name derives from the fact that the function behavior of these circuits can be represented using a finite number of states. 一般有限状态机结构框图 我们知道,任何数字系统都可以分为相互作用的控制单元(control unit)和数据通道(data path)两部分。数据通道通常由组合逻辑构成,而控制单元通常由时序逻辑构成,任何时序电路都可以表示为有限状态机(Finite State Machine,FSM)。本章主要介绍有限状态机实现复杂时序逻辑电路的设计。 数字系统控制部分的每一个部分都可以看作一种状态,与每一控制相关的转换条件指定了状态的下一个状态和输出。根据有限状态机的输出与当前状态和当前输入的关系,可以将有限状态机分成Moore型有限状态机和Mealy型有限状态机两种。从现实的角度,这两种状态机都可以实现同样的功能,但是它们的时序不同, 在图中描述了Moore型有限状态机的示意图 与Moore型有限状态机不同,Mealy型有限状态机的输出不单与当前状态有关,而且还与输入信号的当前值有关。下图描述了Mealy型有限状态机的示意图。 For Example 1: Design a modulo-5 counter. 1.The first step in designing a FSM is to determine how many states are needed and which transitions are possible from one state to another. S0 S1 S4 S3 S2 /0 /0 /0 /0 /1 Figure 4.1 State diagram 2. State Assignment The state diagram in Figure 4.1 defines the five state in terms of letters S0,S1,S2,S3,S4. When implemented in a logic circuit, each state is represented by a particular valuation (combination of values) of state variables. Each state variable may be implemented in the form of a flip-flop. Present state y2y1y0 Next state y2y1y0 Output cout S0: 000 S1: 001 S2: 010 S3: 011 S4: 100 000 001 010 011 100 000 001 0 0 0 0 1 0 Figure 4.2 State-assigned table library ieee; use ieee.std_logic_1164.all; entity state_cn5 is port(clk: in std_logic; y: out std_logic_vector(2 downto 0); cout: out std_logic); end state_cn5; architecture rtl of state_cn5 is type state is (s0,s1,s2,s3,s4); signal presentstate, nextstate: state; begin switch_to_nextstate:process(clk) --主控时序进程 begin if clkevent and clk=1 then presentstate=nextstate; end if; end process switch_to_nextstate; change_state_mode: process(presentstate)-
文档评论(0)