Board logo

标题: 任意整数分频 [打印本页]

作者: latin    时间: 2004-8-9 16:59

你这个程序是不是复杂了点呀
作者: qiangwei    时间: 2004-9-13 20:26

有没有用vhdl语言写的整数份频的程序啊
作者: boyfly    时间: 2004-9-15 09:59

有呀,语言都是差不多的,都可以实现同一个功能!
作者: b004004    时间: 2004-9-27 07:18

看来还是log的朋友多
作者: boyfly    时间: 2004-11-9 12:06     标题: 任意整数分频

呵呵,今天从新回来,为了庆祝给你们发一个任意整数分频的代码: module FREQ_DIVIDER( clkin, clr, odd_even, clk_even, clk_odd, clk_out ); parameter N = 5; input clkin; input clr; input odd_even; //when odd frequency devided, set to '1', otherwise, set to '0' output clk_odd; //clock output after odd divided output clk_even; //clock output after even divided output clk_out; reg out1; reg out2; reg [N/2:0] count1; reg [N/2:0] count2; reg clk_out; wire clk_even; wire clk_odd; //wire odd_even = N - (N/2)*2;// this can be simulated , but can't be synthesible. always @(posedge clkin or posedge clr ) begin if ( clr == 1'b1 ) begin count1 <= 0; out1 <= 0; end else begin count1 <= count1 + 1; if ( count1 == (N+1)/2-1 ) out1 <= ! out1; else if ( count1== N-1 ) begin out1 <= ~ out1; count1 <= 0; end else; end end always @( negedge clkin or posedge clr ) begin if ( clr == 1'b1 ) begin count2 <= 0; out2 <= 0; end else begin count2 <= count2 + 1; if ( count2 == (N+1)/2-1 ) out2 <= ! out2; else if ( count2 == N-1 ) begin out2 <= ~ out2; count2 <= 0; end else; end end assign clk_even = out1; assign clk_odd = out1 | out2;//the constraints of the OR gate must be strict, otherwise, //the 1:1 occupancy ratio can't be satisfied always @( odd_even or clk_even or clk_odd ) begin case ( odd_even ) 0: clk_out = clk_even; 1: clk_out = clk_odd; default: clk_out = clk_even; endcase end endmodule
作者: txj    时间: 2004-11-9 12:06

谢谢boyfly,我正急需,我也编了一个任意整数分频器,但是占用资源太大。
作者: hongyuanjun1983    时间: 2005-4-1 22:23

谁想用VHDL编的呀?跟我探讨。
作者: liuzicai    时间: 2005-4-12 20:35

帅哥,给我一个用VHDL编的吧!跪求!!!毕业设计做不成,我就死定了.救命啊!!!!!!!!!
作者: liuzicai    时间: 2005-4-12 20:36

忘说了,我的邮箱liuzicai20032003@163.com
作者: cxghlj    时间: 2005-4-21 21:47

仿真结果不好相位不能对齐,建议去fpga.com.cn上去看看。
作者: icesat    时间: 2005-4-22 12:23     标题: 我想用VHDL编阿,怎么和你联系呢

我的QQ:632461
作者: COOLDOG    时间: 2005-4-22 14:52

是啊,用VHDL编的。楼主贴出一部分大家讨论一下吧
作者: COOLDOG    时间: 2005-4-22 14:53

是啊,用VHDL编的。楼主贴出一部分大家讨论一下吧
作者: 木子清风    时间: 2005-4-23 15:57     标题: 我也是用VHDL里面有一个是用十分频的

如果你有了该天发给我


我的邮箱andygood111@sohu.com
作者: 木子清风    时间: 2005-4-23 15:59

我要啊.急需




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