piclist 1999\10\25\210545a >
Thread: Two topics - State Machines
face BY : Chris Fanning email (remove spam text)

>     > Software types are likely to cheat and cause their code to break by doin
>     > things only when a state is entered or exitted.
>     AS as "software type", I usually create three states in such cases: One
>     for the "entry" state, one for "polling, looping, etc", and one for the
>     "exit" state.
> Yep.  That'd be the "pure" state machine...
>     I don't know if *this* is cheating or not, but sometimes the next state
>     to be transitioned to from the current state depends on the previous
>     state.
> That's cheating too.  Actually, it sounds like a particular case of
> entry cheating (steady state means that the previous state is the
> current state, right?  So special state entry code is the same as being
> dependent on the previous state...)

It's not cheating at all.  It's merely a "substate" of another state.
If you'd prefer to represent this as a "top level" state it can be
done by breaking this "super state" into "top level" states for each
set of prior and next states.

In hardware this is almost a necessity unless you're using a HDL.  All
software is a state machine, running on a state machine which is
comprised of a whole bunch of other state machines.  It's sort of silly
to try and say that one style of coding is a state machine and another
isn't when every statement affects state regardless.

Even in hardware there's a bunch of different models for constructing
and defining state machines.  They're just styles of state machines, not
the whole class of them.

It just depends on how explicit or implicit the model is.


<199910260104.VAA55746@jingoro.prevmed.sunysb.edu> 7bit

In reply to: <CMM.> from William Chops Westfield at "Oct 25, 1999 2:37:15 pm"
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Two topics - State Machines

month overview.

new search...