reg [31:0] cnt;//位宽自己定义
reg delay;//不知道你要延时什么,就定义了一位的标志位,3s拉高
always @(posedge clk)//clk按照自己的情况
begin
if(rst)begin
delay<=1'b0;
cnt<=32'd0;
end
else begin
if(cnt!=X)begin//X==clk的频率*3
cnt<=cnt+1'b1;
end
else begin
cnt<=cnt;
delay<=1'b1;
end
end
end
温馨提示:答案为网友推荐,仅供参考