>to manage at least 4 different inputs and has 12 states, so the total >dimension for the array is 4 x 12 bytes, and this is the simplest machine. It isn't 4x12 bytes, it's 4 inputs * 12 states. You can encode the new state in only 4 bits, and the action in 4 more bits (unless you have more than 16 transition actions to perform). That's only 48 bytes, and would fit quite well in ROM. >If you have the simplest transition model in which from state 0 you move to >state x, y, etc. not considering different inputs and transitions, you don't >need a state machine, that is a straight procedure flow. You don't "move to state x,y" you move from state x1 to state x2, performing operation (x1,y) prior to the move. You only need to store the current state in memory. The stimulus is simply used to select which column. > I've already coded the whole engine that will "move" the state machines >I need (yes, they are 3 running at the same time in a sort of multitasking) >and it took me 200 bytes. As I'll put the array of data for the state >machines in an external EEPROM, the remaining space I hope will be suffice >for coding the action routines needed to react at state transitions. If you have 3 running at the same time, are they the same machine or a different one for each? In either case, you only need 2 bytes RAM to store the current states for the machines, since they can easily be compressed into nybbles. So you are running an interpreter in your code?!? This is commonly done in set-top cable converters in order to extend functionality. Very good idea, _IF_ you are doing something complex. Otherwise, it's a lot of unnecessary difficulty. Andy ================================================================== Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865 Hardware & Software for Industry & R/C Hobbies "Go fast, turn right, and keep the wet side down!" ==================================================================