集成电路技术分享

 找回密码
 我要注册

QQ登录

只需一步,快速开始

搜索
查看: 1352|回复: 1

我写了一段程序,实现输出延迟输入5个时钟周期,但不对,请高手帮忙

[复制链接]
polozpt 发表于 2011-3-28 19:40:36 | 显示全部楼层 |阅读模式
module gen_clk(inta,clk,outb);
input inta,clk;//intainta,,inta inta
output outb;
reg outb;
reg [3:0] count;
reg temp1,temp2,temp3,temp4;
initial
begin
count=0;
end
always@(posedge clk )begin
count<=count+1;
if(count==1)
begin
temp1<=inta;
end
else if(count==2)
begin
temp2<=temp1;
end
else if(count==3)
begin
temp3<=temp2;
end
else if(count==4)
begin
outb<=temp3;
end
end
endmodule
 楼主| polozpt 发表于 2011-3-30 12:25:03 | 显示全部楼层
回复 1# polozpt


    搞定了,自己的基础还是不行啊
您需要登录后才可以回帖 登录 | 我要注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|手机版|Archiver|集成电路技术分享 ( 京ICP备20003123号-1 )

GMT+8, 2024-5-18 19:59 , Processed in 0.116020 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表