Board logo

标题: 半整数分频器 [打印本页]

作者: COOLDOG    时间: 2005-5-12 13:57     标题: 半整数分频器

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

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

   感激不尽


  [em27]
作者: cooldog    时间: 2005-5-12 14:07

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

xiaoniaolinzi@sina.com
作者: cooldog    时间: 2005-5-13 11:38

有没有人回复呢?
作者: A120    时间: 2005-5-16 10:37

这里给你一点建议:
象这种小数分频可以参考DDS的做法实现,只是得到的时钟抖动会较大,一般是不能直接用的,需要外加DA变换和滤波,再用比较器输出就能得到较好的时钟。
作者: beyond131128    时间: 2005-6-3 20:40

到www.cpld.com里能找到类似的例子
作者: cooldog    时间: 2005-6-7 21:42

DDS实现方法看不是很明白
作者: cooldog    时间: 2005-6-7 22:13

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实现,能否详细解释一下删除部分的程序段(两个★★之间的部分),我看不太懂,谢谢!
作者: shijf1977    时间: 2005-6-8 08:57

(7*3+3*2)/10=2.7
作者: cooldog    时间: 2005-6-8 18:40

不好意思,这个程序用的是吞脉冲法
作者: cooldog    时间: 2005-6-8 18:50

下面是用吞脉冲法一段程序: 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编辑过]






欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0