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

📄 cnt10.vhd

📁 fpga的应用
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity cnt10 is
 port(clk,key: in std_logic;
      cnt: out std_logic_vector(4 downto 0));
end cnt10;
architecture behav of cnt10 is
signal mida: integer range 0 to 10;
signal midb: integer range 0 to 10;
begin
process(key)
   begin
     if key'event and key='1' then
		if mida=10 then
		   mida<=0;
		else
		   mida<=mida+1;
		end if;
	 end if;
	midb<=mida;
end process;
process(clk)
   begin
      if clk'event and clk='1' then
		cnt<=conv_std_logic_vector(midb,5);
	  end if;
end process;
end behav;

⌨️ 快捷键说明

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