要实现oe发生跳变时,这个输出置0,当定时时间到来时这个输出置1;
一下这个程序,帮忙修改下:
module Timer (
input rst,
input oe,
input clk,
output TI_flag
);
parameter
Ttime=100 ;//定时时间
wire flag; //定时器溢出标志位
reg [31:0] count;
assign (supply1 ,weak0)flag= (oe | ~oe) ? 0:1;
assign TI_flag=flag;
always @(posedge clk or negedge rst )
begin
if(!rst)
begin
count<=0;
flag<=0;
#3 flag<=1; //这里线网不能进行赋值
end
else if(count<(Ttime-1)&!TI_flag)
begin
count<=count+1'b1;
end
else
begin
count<=32'b0;
#3 flag<=0;
flag<=1; //定时溢出,标志位置1,定时完成,灭掉LED
end
end
endmodule