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

📄 clk1k.vhd

📁 FPGA控制串行AD(AD0804)
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity clk1k is
port 
(clkin:in std_logic;
 newclk1:out std_logic;
 newclk2:out std_logic
);
end;

architecture behave of clk1k is
signal counter1:integer range 0 to 12499;
signal counter2:integer range 0 to 19;

signal clk1,clk2:std_logic;
begin
	process(clkin)
	begin
		if rising_edge(clkin) then
		   if counter1=12499 then
			counter1<=0;
            clk1<=not clk1;
		   else counter1<=counter1+1;
		   end if;
		end if;
	end process;
   newclk1<=clk1;


	process(clkin)
	begin
		if rising_edge(clkin) then
		   if counter2=19 then
			counter2<=0;
            clk2<=not clk2;
		   else counter2<=counter2+1;
		   end if;
		end if;
	end process;
   newclk2<=clk2;

end;

⌨️ 快捷键说明

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