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

📄 controller.vhd

📁 非整数分频器 分频系数为无限不循环小数 vhdl
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity controller is
	port(clk : in std_logic;
         count_ctrl:in std_logic;
		 control_signal:out std_logic);
end;

architecture main of controller is
signal count: integer range 0 to 32;
signal q,p: std_logic;
begin

process(clk,count_ctrl)
begin
 if falling_edge(clk) then
      if count_ctrl='1' then count<=count+1;
           else if count=32 then count<=0;
			    end if;     
	  end if;
      if (count=1 or count=4 or count=6 or count=9 or count=11 or count=14 or count=16 or count=19 or count=21 or count=24 or count=26 or count=29 or count=31) then
		    p<='1';
	    else
		    p<='0';
	  end if;
 end if;
control_signal<=p;
end process;
end;

⌨️ 快捷键说明

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