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

📄 clk_div.vhd

📁 用VKDL语言编写的PWM控制程序很有用本例只做了5路PWM
💻 VHD
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity clk_div is
port(clk:in std_logic;
	clk1:out std_logic;
	clk16:out std_logic;
	clk512:out std_logic);
end;
architecture one of clk_div is
signal clk1_1:std_logic;
signal clk2_2:std_logic;
signal clk3_3:std_logic;
begin
process(clk)
variable count:integer range 0 to 4;-----10
begin
if clk'event and clk='1'then
	if count=4 then
		clk1_1<=not clk1_1;
		count:=0;
	else
		count:=count+1;
		end if;
end if;
end process;
-------------------------------
process(clk)
variable count:integer range 0 to 2;------6
begin
if clk'event and clk='1'then
	if count=2 then
		clk2_2<=not clk2_2;
		count:=0;
	else
		count:=count+1;
		end if;
end if;
end process;
-----------------------------------
process(clk)
begin
if clk'event and clk='1'then
		clk3_3<=not clk3_3;
		end if;
end process;
clk1<=clk1_1;
clk16<=clk2_2;
clk512<=clk3_3;
end;

⌨️ 快捷键说明

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