从网上下载了一段代码 但是关于分频器有点看不懂
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity fenpin is
port(clk:in std_logic;
-- q:out std_logic_vector(9 downto 0);
clk512,clk4,clk1,clk16,clk256:out std_logic);
end fenpin;
architecture behave of fenpin is
signal y:std_logic_vector(9 downto 0);
begin
process(clk)
begin
if(clk='1')then
if(y="1111111111")then
y<="0000000000";
clk512<=y(0);
clk256<=y(1);
clk16<=y(5);
clk4<=y(7);
clk1<=y(9);
else
y<=y+'1';
clk512<=y(0);
clk256<=y(1);
clk16<=y(5);
clk4<=y(7);
clk1<=y(9);
end if;
end if;
end process;
end behave;
这里的y什么时候被赋值 还有分频器的作用是啥