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

📄 cnt10d.vhd

📁 (1)设计4位十进制频率计测量范围: 1Hz~9999Hz (2)测量的数值通过4个数码管显示 (3)频率超过9999Hz时
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity cnt10d is
port(clk,rst,en : in std_logic;
               cq : out std_logic_vector(3 downto 0);
             cout : out std_logic);
end cnt10d;
architecture behav of cnt10d is
begin
process(clk,rst,en)
  variable cqi : std_logic_vector(3 downto 0);
begin
    if rst='1' then cqi:=(others=>'0');
    elsif clk'event and clk='1' then
       if en='1' then
          if cqi<9 then cqi:=cqi+1;
          else cqi:=(others=>'0');
          end if;
       end if;
    end if;
    if cqi=9 then cout<='1';
    else cout<='0';
    end if;
     cq<=cqi;
   end process;
   end;

⌨️ 快捷键说明

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