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

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜全文
查看: 3266|回复: 2

[讨论] 实现按键去抖功能,中间定义的过程能否实现延时功能啊

[复制链接]
发表于 2014-6-26 12:20:46 | 显示全部楼层 |阅读模式

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

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

×
library ieee;
use ieee.std_logic_1164.all;
--主体
entity exp5 is
port
        (
                clc_sys,input : in std_logic;
                output : out std_logic
        );
end exp5;
-- 结构体
architecture qudou of exp5 is
   signal out_signal: std_logic;
        --延时过程
        procedure yanshi(constant n:in integer)is
        variable i:integer:=0;
        begin  
          if clc_sys'event and clc_sys='1' then
            i:=i+1;
          end if;
          if i=n then
            return;
          end if;
   end procedure yanshi;
        --主进程
begin
        process(input)
        begin
          if input'event and input='0' then  
            yanshi(1000000);
          if input='0' then
            out_signal<=not out_signal;
            output<=out_signal;
          end if;
          end if;
        end process;
end qudou;
发表于 2014-6-26 19:44:19 | 显示全部楼层
感觉不行吧……感觉procedure和function主要是用来设计组合逻辑,好像主要针对constant吧……延时计数应该使用时序逻辑……网上有很多VHDL消抖程序,可以查一下!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-6-27 14:54:56 | 显示全部楼层
回复 2# yucaoxilin


在网上找到了去抖的程序,但是如果想写一个供调用的延时子程序,应该用什么写呢。。。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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


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

GMT+8, 2025-9-14 10:32 , Processed in 0.016639 second(s), 6 queries , Gzip On, Redis On.

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