output out;
input in;
input clk;
input rst;
reg out;
reg [2:0] m;
reg [3:0] count;
always@(posedge in or negedge rst)
begin
if(!rst)
begin
m<=0;
end
else
begin
m<=m+1;
end
end
always@(posedge clk or negedge rst)
begin
if(!rst)
begin
count<=0;
out<=0;
end
else if(count==4'b1110)
begin
if(m<=3'b001)
out<=0;
else
out<=1;
count<=count+1;
end
else if(count==4'b1111)
count<=0;
m<=0;
else
count<=count+1;
end
endmodule