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

任意整数分频

你这个程序是不是复杂了点呀
有没有用vhdl语言写的整数份频的程序啊
有呀,语言都是差不多的,都可以实现同一个功能!
我是天堂的使者,向我倾诉吧
看来还是log的朋友多
相互帮助,互相提携

任意整数分频

呵呵,今天从新回来,为了庆祝给你们发一个任意整数分频的代码: 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
我是天堂的使者,向我倾诉吧
谢谢boyfly,我正急需,我也编了一个任意整数分频器,但是占用资源太大。
谁想用VHDL编的呀?跟我探讨。
帅哥,给我一个用VHDL编的吧!跪求!!!毕业设计做不成,我就死定了.救命啊!!!!!!!!!
忘说了,我的邮箱liuzicai20032003@163.com
仿真结果不好相位不能对齐,建议去fpga.com.cn上去看看。

我想用VHDL编阿,怎么和你联系呢

我的QQ:632461
是啊,用VHDL编的。楼主贴出一部分大家讨论一下吧
是啊,用VHDL编的。楼主贴出一部分大家讨论一下吧

我也是用VHDL里面有一个是用十分频的

如果你有了该天发给我


我的邮箱andygood111@sohu.com
我的最爱!
我要啊.急需
我的最爱!
返回列表