⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scan_count.vhd

📁 VHDL源代码下载
💻 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 + -