简易数字频率计_基于vhdl内容摘要:

lock=lock1。 grade=01。 if(ascend=39。 139。 and descend=39。 039。 ) then—若升档信号 =’1’,则转入 s2状态 state=s2。 clrad=39。 139。 读取档位升降信号后发出清档位信号,防止档位继续改变 else state=s1。 clrad=39。 039。 否则停留在 s1状态 end if。 when s2=第二档 doorout=x2。 clr=clr2。 lock=lock2。 8 / 15 grade=10。 if(descend=39。 139。 and ascend=39。 039。 ) then—若降档信号 =’1’,则转入 s1状态 state=s1。 elsif(ascend=39。 139。 and descend=39。 039。 ) then—若升档信号 =’1’,则转入 s3 状态 state=s3。 else state=s2。 clrad=39。 039。 否则停留在 s2状态 end if。 when s3=第三档 doorout=x3。 clr=clr3。 lock=lock3。 grade=11。 if(descend=39。 139。 and ascend=39。 039。 ) then—若降档信号 =’1’,则转入 s2状态 state=s2。 clrad=39。 139。 else state=s3。 clrad=39。 039。 否则停留在 s3状态 end if。 when others= doorout=x2。 clr=clr2。 lock=lock2。 grade=10。 state=s2。 clrad=39。 139。 end case。 end if。 end process p1。 END control_architecture。 count计数模块 LIBRARY ieee。 USE。 USE。 ENTITY count IS PORT ( clrad : in std_logic。 清升降档 doorin : IN STD_LOGIC。 门控信号 clr : IN STD_LOGIC。 清零信号 input_s : IN STD_LOGIC。 待测信号输入 9 / 15 tp1 : OUT STD_LOGIC_VECTOR(3 downto 0)。 最低位 tp2 : OUT STD_LOGIC_VECTOR(3 downto 0)。 tp3 : OUT STD_LOGIC_VECTOR(3 downto 0)。 tp4 : OUT STD_LOGIC_VECTOR(3 downto 0)。 最高位 ascend : OUT STD_LOGIC。 升 descend : OUT STD_LOGIC—降 )。 END count。 ARCHITECTURE count_architecture OF count IS signal tq1,tq2,tq3,tq4:std_logic_vector(3 downto 0)。 BEGIN process(input_s,clr,clrad,doorin) begin if(clr=39。 139。 and doorin=39。 039。 ) or (clrad=39。 139。 ) then –清零信号 clr 或请档位信号 clrad=’1’时,清零 tq1=0000。 tq2=0000。 tq3=0000。 tq4=0000。 descend=39。 039。 ascend=39。 039。 异步清零 elsif(input_s39。 event and input_s=39。 139。 ) then if doorin=39。 139。 then—门控信号为高电平则计数开始 if tq1=1001 then tq1=0000。 if tq2=1001 then tq2=0000。 if tq3=1001 then tq3=0000。 低位 =9 则进位到高位 if tq4=1001 then tq4=1111。 ascend=39。 139。 若 9999则升档信号 =’1’, tq 置为 ”1111”防止以后检测为降档 else t。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。