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

📄 counter2.vhd

📁 VHDL的数字电子钟程序
💻 VHD
字号:
-------------------------------fenpinqi----------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith;
entity counter2 is 
port(clk: in std_logic;
      en: in std_logic;
      output: out std_logic);
end counter2;
architecture a of counter2 is
signal temp:std_logic_vector(3 downto 0);
begin
p1:process(clk)
  begin
    if(temp="0001")then output<='0';
     else output<='1';
     end if;
  end process;
 p2:process(clk,en)
  begin 
     if(en='1')then temp<="0000";
     elsif(clk'event and clk='1')then 
      if(temp="0001")then temp<="0000";
       else temp<=temp+1;
      end if; 
     end if;
   end process;   
end a;

⌨️ 快捷键说明

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