Altera_Forum
Honored Contributor
13 years agodelaying state transitions in FSM
Hello,
I am interested to know about the various methods for delaying the state transitions between different states in a FSM. Currently I use the clock signal in my design to drive a counter, which is compared with a max_count (say equal to 10). If they are equal, then I enable the signal. So I delay the transition by 10 cycles. // here is a scrap code of my implementation
max_count= 'd10;
always@(posedge clk)
if(reset)
begin//{
count_enable<= 'b0;
count<='b0;
end//}
always@(posedge clk)
if(count_enable)
count<= count+'b1;
else
count<= 'b0;
// in the state machine inside each states
always@(*)
...
switch(ps)
idle:
state1:
if((count==max_count)&(..condition..)
ns= state 2;
state 2:
********** I wish to know if my approach is right. And would also like to know it there is some other way to implement the delay between states. Any suggestion is appreciated. thanks, Manihatn