fredivn.vhd

来自「一个基于vhdl语言的脉冲宽度调制。并且有两个脉冲输出」· VHDL 代码 · 共 27 行

VHD
27
字号
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity fredivn is
	GENERIC (N: integer := 8);
	port(
		clk :		in std_logic;
		outclk :	out std_logic
		);
end fredivn;
architecture behave of fredivn iS
	signal  count : integer range 0 to N-1;
begin
	process(clk) 
	begin
		if(clk'event and clk = '1') then
			count <= count + 1;
			if(count < integer(N/2)) then
				outclk <= '0';
			else
				outclk <= '1';
			end if;
		end if;
	end process;
end behave;

⌨️ 快捷键说明

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