State Transition

We can describe state and state transitions in a stage with NSL. At power on reset, state will start with 'first_state'. The state will not changed whenever the stage is terminated and/or invoked.

Example-NS17

declare NS17 { func_in do(); } module NS17 { proc_name p(); func do { p(); } proc p { state_name st1,st2,st3; first_state st1; state st1 goto st2; state st2 goto st3; state st3 { goto st1; finish; } } }



We will make a simulation on this circuitry as following command:

# ./exe NS17



The result will be available on your console.



do:1 state:st1 do:0 state:st2 do:0 state:st3 do:0 state:st1 do:1 state:st1 do:0 state:st2 do:0 state:st3 do:0 state:st1 do:1 state:st1 do:0 state:st2 do:0 state:st3 do:0 state:st1 do:1 state:st1 do:0 state:st2 do:0 state:st3 do:0 state:st1



The state is hold in a state register and the value associated with the stage name is defined by compiler automatically.

Now see the wave form of the simulation.

# ./exe -wave NS17






PREV UP