always @(posedge clk or posedge rst);
reg [3:0] state ;
begin
if (rst)begin
state = 0;
//and do some other initiations
end ;
else if (state==STATE_1)
begin
if (input ==1)//illustate some conditions
begin
state=STATE_2;
end
else if ()//some other conditions
begin
//state = STATE_3;
//and do some other thing ext.
end
end
end