首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

半整数分频器

半整数分频器

用FPGA设计一个半整数分频器,分频比为2.7

    恳请提供一个设计方案,要设计两个计数器,怎么设计?

   感激不尽


  [em27]
有消息的话发我油箱啊,小女子谢谢各位大虾

xiaoniaolinzi@sina.com
有没有人回复呢?
这里给你一点建议:
象这种小数分频可以参考DDS的做法实现,只是得到的时钟抖动会较大,一般是不能直接用的,需要外加DA变换和滤波,再用比较器输出就能得到较好的时钟。
到www.cpld.com里能找到类似的例子
DDS实现方法看不是很明白
entity DDS is Port( resetn : in std_logic; clk_in : in std_logic; clk_out : out std_logic; count_out : out std_logic_vector(MM downto 0) ); end DDS; architecture arch_DDS of DDS is signal count : std_logic_vector(MM downto 0); signal clk : std_logic; signal sign_del : std_logic; begin ★★ process(resetn,clk_in) variable count_v : std_logic_vector(MM downto 0); begin if resetn='0' then count_v:=(others=>'0'); sign_del<='0'; count<=(others=>'0'); elsif clk_in'event and clk_in='1' then count_v:=count_v+N; if count_v>=M then count_v:=count_v-M; count<=count_v; sign_del<='0'; else count<=count_v; sign_del<='1'; end if; end if; end process; ★★ process(resetn,clk_in) begin if resetn='0' then count_out<=(others=>'0'); elsif clk_in'event and clk_in='0' then count_out<=count; end if; end process; clk<=not clk_in; clk_out<=clk and sign_del; end arch_DDS; 这个用DDS实现,能否详细解释一下删除部分的程序段(两个★★之间的部分),我看不太懂,谢谢!
(7*3+3*2)/10=2.7
不好意思,这个程序用的是吞脉冲法
下面是用吞脉冲法一段程序: entity DDS is Port( resetn : in std_logic; clk_in : in std_logic; clk_out : out std_logic; count_out : out std_logic_vector(MM downto 0) ); end DDS; architecture arch_DDS of DDS is signal count : std_logic_vector(MM downto 0); signal clk : std_logic; signal sign_del : std_logic; begin ★★ process(resetn,clk_in) variable count_v : std_logic_vector(MM downto 0); begin if resetn='0' then count_v:=(others=>'0'); sign_del<='0'; count<=(others=>'0'); elsif clk_in'event and clk_in='1' then count_v:=count_v+N; if count_v>=M then count_v:=count_v-M; count<=count_v; sign_del<='0'; else count<=count_v; sign_del<='1'; end if; end if; end process; ★★ process(resetn,clk_in) begin if resetn='0' then count_out<=(others=>'0'); elsif clk_in'event and clk_in='0' then count_out<=count; end if; end process; clk<=not clk_in; clk_out<=clk and sign_del; end arch_DDS; 这个用DDS实现,能否详细解释一下删除部分的程序段(两个★★之间的部分),我看不太懂,谢谢![em27][em14]

[此贴子已经被作者于2005-6-8 18:50:49编辑过]

返回列表