1296000440867187505有限状态机设计.ppt

  1. 1、本文档共51页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
1296000440867187505有限状态机设计

IF clkEVENT AND clk = 1 THEN case state is when sd = if x=1 then z=1;else z=0; end if; when others = z=0; end case; end if; end process; END behave; 第5章、 有限状态机设计 0/0 1/0 1/0 sa 1/0 0/0 0/0 0/0 sb sc sd x/z 1/1 RESET “1111”序列检测器仿真时序图 第5章、 有限状态机设计 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_signed.all; ENTITY stack IS --16*8 PORT ( datain : IN std_logic_vector(7 downto 0); push,pop,reset,clk : IN std_logic; stackfull : out std_logic; dataout :buffer std_logic_vector(7 downto 0)); END stack; 例 、堆栈(stack)设计 第5章、 有限状态机设计 ARCHITECTURE a OF stack IS type arraylogic is array (15 downto 0) of std_logic_vector(7 downto 0); signal data : arraylogic; --此处定义了data为一个数组16?8 signal stackflag:std_logic_vector(15 downto 0); BEGIN stackfull=stackflag(0); process(clk,reset,pop,push) variable selfunction :std_logic_vector(1 downto 0); begin selfunction:=pushpop; if reset=‘1’ then 第5章、 有限状态机设计 stackflag=(other=’0’); dataout=(other=’0’); for i in 0 to 15 loop data(i)=; end loop; elsif clk’event and clk=‘1’ then case selfunction is when 10= --push data(15)=datain; --每个8位 stackflag=1 stackflag(15 downto 1); FOR i IN 0 to 14 LOOP data(i)=data(i+1); END LOOP; 第5章、 有限状态机设计 when “01”= --pop dataout=data(15); stackflag= stackflag(14 downto 0)’0’; for i in 15 downto 1 loop data(i)=data(i-1); end loop; when others =null; end case; end if; end process; End a; 第5章

您可能关注的文档

文档评论(0)

yaobanwd + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档