网站首页
IC库存
IC展台
电子资讯
技术资料
PDF文档
我的博客
IC72论坛
ic72 logo
资料首页最新产品 技术参数 电路图 设计应用 解决方案 代理商查询 IC替换 IC厂商 电子辞典
关键字: 技术文章 PDF资料 IC价格 电路图 代理商查询 IC替换 IC厂商 电子辞典

奇数次分频器

MODULE count(out,clk,clr);
parameter N=5;
output out;
input clk,clr;
reg out1,out2;
reg [N/2:0] count1,count2;
always @(posedge clk or posedge clr )
if(clr) begin
count1=0;
out1=0;
end
else begin
count1 = count1 + 1;
if( count1 == ((N+1)/2))
out1 =!out1;
else if (count1==N)
begin
out1=~out1;
count1=0;
end
end
always @(negedge clk or posedge clr )
if(clr) begin
count2=0;
out2=0;
end
else begin
count2 = count2 + 1;
if( count2 == (N+1)/2 )
out2 =!out2;
else if (count2==N)
begin
out2=~out2;
count2=0;
end
end
assign out=out1out2;
endMODULE

可以在其他程序中调用,例如七分频 :
......
count #(7) counter(out,clk,clr);
......


热门搜索:1301380020 PS120406 2839240 TLP1210SATG 2920078 TLM626NS TLM825SA 6SPDX 6NX-6 TLP810NET 01C1001JF 2858030 TLP602 UL603CB-6 TLP76MSG LC1800 B10-8000-PCB 2811271 UL24CB-15 SUPER6OMNI D CC2544RHBR 602-15 BSV52R 2838733 PS-415-HG
COPYRIGHT:(1998-2010) IC72 达普IC芯片交易网
客户服务:service@IC72.com 库存上载:IC72@IC72.com
(北京)联系方式: 在线QQ咨询:点击这里给我发消息 联系电话:010-82614113 传真:010-82614123
京ICP备06008810号-21 京公网安备 11010802032910 号 企业资质