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

📄 vhdl1.vhd

📁 一些很好的FPGA设计实例
💻 VHD
字号:
---模八计数器,都需使用寄存器来保存3位的当前计数值

entity jishuqi is
   port (clk,rst: in  bit;
         count: out integer range 0 to 7);
end jishuqi;
------------------------------
architecture jishuqi of jishuqi is
begin 
   process(clk,rst)
   variable temp : integer range 0 to 7;
   begin 
   if (rst = '1')then     
   temp := 0;
   elsif (clk 'event and clk = '1')then
     temp := temp+1;
end if;
count <= temp;
end process;
end jishuqi;
--------------------------------



entity jishuqi is
   port (clk,rst: in  bit;
         count: buffer integer range 0 to 7);
end jishuqi;
------------------------------
architecture jishuqi of jishuqi is
begin 
   process(clk,rst)
   begin 
   if (rst = '1')then     
   count <= 0;
   elsif (clk 'event and clk = '1')then
    count <= count+1;
end if;
end process;
end jishuqi;
---------------
--没有用到std_logic,所以没有进行std_logic_1164包集的声明

⌨️ 快捷键说明

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