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

📄 jishu.vhd

📁 简单的数字频率计
💻 VHD
字号:
library ieee;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;

entity jishu is
  port (cp:in std_logic;
		rd:in std_logic;
		c:out std_logic;
		qa,qb,qc,qd:out unsigned(3 downto 0));
end jishu;

architecture jishu_arch of jishu is
signal iqa,iqb,iqc,iqd:unsigned(3 downto 0);
signal tc:std_logic;
begin
process(cp,rd,iqa,iqb,iqc,iqd)
begin 
  if rd='0' 
  then iqa<="0000";iqb<="0000";iqc<="0000";iqd<="0000";tc<='0';
  elsif (cp'event)and(cp='1') then
  if iqd<9 then iqd<=iqd+1; else iqd<="0000";
   if iqc<9 then iqc<=iqc+1; else iqc<="0000";
    if iqb<9 then iqb<=iqb+1; else iqb<="0000";
     if iqa<9 then iqa<=iqa+1; else tc<='1';
  end if;end if;end if;end if;
  end if;
end process;
process(rd)
begin
if (rd='0')and(rd'event) then qa<=iqa;qb<=iqb;qc<=iqc;qd<=iqd;c<=tc;
end if;
end process;
end jishu_arch;

⌨️ 快捷键说明

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