//***************************
always@(posedge clk_in or reset)
begin
if(reset==1)
begin
lowtime=10;
hightime=100;
hnumber=10;
sgn_out=0;
end
else
if(hnumber> 0)
if(sgn_out==0)
if(lowtime> 0)
lowtime=lowtime-1;
else
begin
lowtime=10;
sgn_out=~sgn_out; //reverse output
end
else
if (hightime> 0)
hightime=hightime-1;
else
begin
hightime=100;
sgn_out=~sgn_out; //reverse output
hnumber=hnumber-1; //counter high output number
end
end
//***********************