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

📄 selectswitch.vhd

📁 此为用VHDL编写的可实现动感图像的点阵
💻 VHD
字号:
library ieee;
use  ieee.std_logic_1164.all;
use  ieee.std_logic_signed.all;
entity selectswitch  is
      port(
            clk:in std_logic;
            key: in std_logic;
            en:out std_logic_vector(1 downto 0)
            );
end selectswitch;
architecture  behavor  of selectswitch is
      signal cp:std_logic;
      signal jsp:integer  range 0 to 5;
      signal count: std_logic_vector(1 downto 0):="00";
      begin
process(clk)
      begin
 if(clk'event and clk='1')then
       if(key='1') then
              if jsp=5  then
                jsp<=jsp;
              else
                 jsp<=jsp+1;
              end if;
           end if;
       if (jsp>=4 and key='0' ) then
              cp<='1';jsp<=0;
          else
               cp<='0';
        end if;
end if;

end process;
process(cp)
begin
     if(cp'event and cp='1')then
              count<=count+1;
     else
              count<=count;
     end if;
     en<=count;
end process;
end behavor;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -