请问基于VHDL的按键消抖问题?
消抖程序如下:library ieee ;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity debounce is
port(
key_pressed : in std_logic;--key_pressed?
clk : in std_logic;--clock for synchrony
key_valid : out std_logic);--key_valid?
end debounce;
architecture behavior of debounce is
begin
debounce:process(clk,key_pressed)
variable dbnq : std_logic_vector(5 downto 0);
begin
if (key_pressed='1') then
dbnq:="111111";--unkey_pressed,counter reset at 63
elsif (clk'event and clk='1') then
if dbnq/=1 then
dbnq:=dbnq-1;--key_pressed not enough long time
end if; --counter still subtract one
end if;
if dbnq=2 then
key_valid<='1';--key_valid after key_pressed 1/63k second
else
key_valid<='0';--key_invalid
end if;
end process;
end behavior;
然后我想请问:dbnq/=1这句话是什么意思?特别是/=这个语法没见过,我是初学VHDL,
如果那位高手有空的话,帮忙写一下每一行的具体意思?谢谢了 不等于? 回复【1楼】lieshi
-----------------------------------------------------------------------
请教高手能否给解释一下这个语法的思想 为什么没人指点呀? Copy下来,参考,俺也刚开始学 看看
页:
[1]