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

📄 cnt6.vhd

📁 数字秒表的VHDL设计,能精确到百分秒,在6位数码管上显示,分别有秒,分,小时,通过目标芯片EPF10KLC84-4验证
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cnt6 is
    port(clk:in std_logic;
         clr:in std_logic;
         ena:in std_logic;
         cq:out std_logic_vector(3 downto 0);
         carry_out:out std_logic);
 end entity cnt6;
architecture art of cnt6 is
   signal cqi,cqh:std_logic_vector(3 downto 0);
   begin
     process(clk,clr,ena)is
       begin 
        if clr='1' then cqi<="0000";
           elsif clk'event and clk='1' then
             if ena='1' then
                if cqi="0101"then 
                  cqi<="0000";
                  else cqi<=cqi+1;
                 end if;
              end if;
         end if;
       end process;
       process(cqi) is
         begin 
           if cqi="0000" then carry_out<='1';
              else carry_out<='0';
           end if;
       end process;
       cq<=cqi;
 end architecture art;

⌨️ 快捷键说明

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