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

📄 fenpinqi.vhd

📁 一些很好的FPGA设计实例
💻 VHD
字号:
--对时钟进行6分频的电路:两个输出,一个基于信号count1一个基于变量count2

-----------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
-----------------------------------------------------
entity fenpinqi is
 port ( clk : in std_logic;
       out1,out2 : buffer std_logic);
end fenpinqi;
-----------------------------------------------------
architecture example of fenpinqi is
   signal count1: integer range 0 to 7;
begin 
   process(clk)
   variable count2 : integer range 0 to 7;
begin 
  if (clk 'event and clk = '1')then
  count1 <=count1+1;
  count2 <=count2+1;
      if (count1 = 5 )then
      out1 <= not out1
      count1 <= 0;
      end if;
      if (count2 = 5 )then
      out1 <= not out2
      count2 := 0;
      end if;
  end if;
   end process;
end example;
-----------------------------------------------------

⌨️ 快捷键说明

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