Board logo

标题: 我写了一段程序,实现输出延迟输入5个时钟周期,但不对,请高手帮忙 [打印本页]

作者: polozpt    时间: 2011-3-28 20:44     标题: 我写了一段程序,实现输出延迟输入5个时钟周期,但不对,请高手帮忙

我写了一段程序,实现输出延迟输入5个时钟周期,但不对,请高手帮忙
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





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