在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1813|回复: 1

[求助] 求助高手 帮忙看看这个消抖动程序有什么问题

[复制链接]
发表于 2010-6-19 12:50:22 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
library ieee;--消抖动 延迟10ms
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity dou is
port(s,clk1k:in std_logic;
     sout std_logic);
end;
architecture one of dou is
signal cout4 :std_logic_vector(3 downto 0);
signal f,en:std_logic;
begin
process(s)
begin
if s'event and s='1'then
f<='1';end if;
end process;
process(clk1k,f)
begin
if f='1' then
if clk1k'event and clk1k='1' then
if cout4=9 then cout4<=(others=>'0');en<='0';f<='0';
else cout4<=cout4+1;en<='1';end if;end if;
else cout4<=(others=>'0'); en<='0';
end if;
end process;
process(en)
constant a:std_logic:='0';
begin
if en='1' then
so<=a;else so<=s;
end if;
end process;
end;
发表于 2010-6-20 16:00:42 | 显示全部楼层
The internal signal 'f' is set at "first" rising edge of signal 's'.

'f' is never cleared and will be latched at '1' forever.

Depends on design goal, there shall be a clear condition for 'f'.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

X

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-6-28 23:55 , Processed in 0.034199 second(s), 11 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表