集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1166|回复: 3

急求大神啊!!!!

[复制链接]
tiankongzhang 发表于 2013-10-27 16:49:02 | 显示全部楼层 |阅读模式
我刚学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是怎么意思,我不明白。
ytphrx 发表于 2013-10-28 19:23:40 | 显示全部楼层
这个分频方法不对。而且看程序想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;
 楼主| tiankongzhang 发表于 2013-10-30 13:27:05 | 显示全部楼层
ytphrx 发表于 2013-10-28 19:23
这个分频方法不对。而且看程序想208分频。
16分频是这么来的:
process(clk,reset)

我也看得云里雾里的,看了你的程序,清楚多了,thank you!
IPO 发表于 2013-11-1 07:02:17 | 显示全部楼层
Gggggggggg
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|fpga论坛|fpga设计论坛 ( 京ICP备20003123号-1 )

GMT+8, 2025-5-8 04:45 , Processed in 0.066021 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表