我刚学FPGA,对下面程序有点不解,求大神指教啊
process(clk,reset)
variable cnt:integer range 0 to 300:=0;
begin
if resetb='1' then cnt:=0;bclk<='0';
elsif rising_edge(clk) then
if cnt>=208 then
cnt:=0;
bclk<=1;
else
cnt:=cnt+1;
bclk<=0;
end if;
end if;
end process;
它要求得到16分频的时钟,那么cnt>=208是怎么意思,我不明白。
这个分频方法不对。而且看程序想208分频。
16分频是这么来的:
process(clk,reset)
variable cnt:integer range 0 to 300:=0;
begin
if reset='1' then cnt:=0;bclk<='0';
elsif rising_edge(clk) then
if cnt>=8 then
cnt:=0;
bclk<=not bclk;
else
cnt:=cnt+1;
end if;
end if;
end process;