frediv.vhd

来自「基于芯片MAX502的十二位并行DAC芯片的程序」· VHDL 代码 · 共 26 行

VHD
26
字号

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity freqdiv is
port(clock:in std_logic;
     clkout:out std_logic);	
end freqdiv;

architecture freqdiva of freqdiv is
signal clk2:std_logic:='0';
begin
  process(clock) 
  variable clk:integer :=0;
  begin		
	if(clock'event and clock='1') then
		clk:=clk+1;
		if clk>=20 then
			clk2<=not clk2;
			clk:=0;
		end if;
	end if;	
  end process;
clkout<=clk2;
end;

⌨️ 快捷键说明

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