📄 scan_count.vhd
字号:
--scan_count.vhd scan keypress counter
library ieee ;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity scan_count is
port(
clk : in std_logic;--clock
scan_f : in std_logic;--1khz clock
key_pressed : in std_logic;--detect key_preeed to stop counter
scan_cnt : out std_logic_vector(3 downto 0));--count
end scan_count;
architecture behavior of scan_count is
signal qscan : std_logic_vector(3 downto 0);
begin
scan_1:process(clk,scan_f,key_pressed)
begin
if (clk'event and clk='1') then
if(scan_f='1' and key_pressed='1') then
qscan<=qscan+1;
end if;
end if;
end process;
scan_cnt<=qscan;
end behavior;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -