第1个回答 2011-07-05
我给你一个65536分频,如果你想要得到其他的分频,你可以通过改变65536来得到
library ieee;
use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity fenpin is
port(clk: in std_logic;
clk_div4: out std_logic);
end fenpin;
architecture art of fenpin is
signal count : std_logic_vector(15 downto 0);
begin
process(clk)
begin
if(clk'event and clk='1') then
if(count = "1111111111111111") then
count<=(others=>'0');
else
count<= count + 1;
end if;
end if;
end process;
clk_div4<= count(15);
end art;本回答被网友采纳