This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Executing more than one Finate State machines

Hai All,

Now I am working in finite state machines and Now I am in need of executing more than one finite state machines parallel.....and one FSM should be able to see the state of other FSM....that is one FSM state will be input of other FSM.......is it possible in 8051 programming....
FSM1 FSM2 .......FSMN

State1 State1 ..........
State2 State2 ..........
State3 State3 ..........
. .
. .
StateN StateN ..........

As shown above there shall be N number of FSMs...in the system and each and every FSM shall share common input table and output table...each FSM transition condition shall be based on inputs and state of other FSM....

For example for FSM1 to transfer from State 1 to State 2...It needs input IP1=1 and IP2=0....and FSM2 should be in State 3..FSM3 should be in State2...

FSM1
Current State:State 1
Transition1: State1-->State2
Condition: IP1=1 && IP2=0 && FSM2=State3 && FSM3=State2
Next State: State2

Like this I am in need of running a parallel FSMs to be executed...Kindly help me......
with regards,
Karthik Ragunath.

Parents
  • You can't have multiple concurrently changing FSM.

    But you can have a loop that constantly performs:

    for (;;) {
        eval_fsm1();
        eval_fsm2();
        eval_fsm3();.
        ...
        eval_fsmn();
    }
    


    Just make sure that you really do need n FSM that each depends on one or more other FSM, since the number of possible state combinations will be very high. Exactly how do you plan to prove the correctnes of the full system? You must prove every single state combination - that it leads to a correct state, and that you don't get any unexpected state loops.

    An extra challenge is that changes will ripple through your state machines depending on where the loop currently is. This must be taken into account when you prove the soundnes of the FSM state changes. One solution to this can be that you let all FSM compute their new state based on the previous state of all FSM. then you step the state of all FSM before performing the next evaluation:

    for (;;) {
        eval_fsm1();
        eval_fsm2();
        eval_fsm3();
        ...
        eval_fsmn();
        step_fsm_states();
    }
    

Reply
  • You can't have multiple concurrently changing FSM.

    But you can have a loop that constantly performs:

    for (;;) {
        eval_fsm1();
        eval_fsm2();
        eval_fsm3();.
        ...
        eval_fsmn();
    }
    


    Just make sure that you really do need n FSM that each depends on one or more other FSM, since the number of possible state combinations will be very high. Exactly how do you plan to prove the correctnes of the full system? You must prove every single state combination - that it leads to a correct state, and that you don't get any unexpected state loops.

    An extra challenge is that changes will ripple through your state machines depending on where the loop currently is. This must be taken into account when you prove the soundnes of the FSM state changes. One solution to this can be that you let all FSM compute their new state based on the previous state of all FSM. then you step the state of all FSM before performing the next evaluation:

    for (;;) {
        eval_fsm1();
        eval_fsm2();
        eval_fsm3();
        ...
        eval_fsmn();
        step_fsm_states();
    }
    

Children
No data