Problems with the timeline to interpret and state machine "Moore" - Page 1
Forum section: electronics / beginners

author: jaimepeña
author_rank: Newbie
timestamp: December 16, 2020, 07:59:54 pm
content: Hi everyone,I need help with this timeline,I've this drawing of moree's law in which there are different states, in my timeline the state starts from Move and the X is set with the number 3 in hexadecimal. The output value m in the states of move and updt the value m is obtained by an integer division of the value of X at that moment.This is the beginning of the schedule, which we can see that the X has a value of 3 and is in the Move state, with this information I have to get everything else (state, X and m).With all this information I have managed to make this schedule, but they tell me that it is wrong and I do not understand why,I have been looking through many sites but I have not found the solution to my problem, thank you very much in advance!

author: fourfathom
author_rank: Super Contributor
timestamp: December 16, 2020, 08:39:56 pm
content: Are you referring to a "Moore" state machine (as opposed to a "Mealy" machine)? "Moore's Law" is a completely different concept, describing the rate of transistor count growth in integrated circuits.

author: jaimepeña
author_rank: Newbie
timestamp: December 16, 2020, 09:15:47 pm
content: Sorry, I was referring to a state machine "Moore"

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 18, 2020, 12:23:04 am
content: The diagram notation is unfamiliar to me. What is p? What does the prime (') signify?Start by describing each possible transition from each node.You have four states: INIT, WAIT, MOVE, and UPDT.INIT has only one transition to WAIT.WAIT has two possible transitions. One, marked (X=0), is to itself. The other, marked (X=0)' is to MOVE state. Does the prime (') signify logical inversion, i.e. is (X=0)' the same as (X≠0)?MOVE has three possible transitions. To WAIT if (X=0); to itself if (X=0)'·p'; and to UPDT if (X=0)'·p.UPDT has only one transition, to WAIT.Thus, it looks like theactual stateincludes the variable X, and p and D are the inputs. (In such cases, I call X astate variable. Then, in the technical sense, the state of the machine is the tuple (state, X). It does not matter much in real life, as it just makes it simpler to draw the diagrams, as there are fewer nodes.)The difference between a Moore machine and a Mealy machine is that in a Moore machine, each node/state is associated with an output; and in a Mealy machine, each transition is associated with an output. (All Moore machines can be expressed as Mealy machines, but not all Mealy machines can be expressed as Moore machines. I prefer the Mealy machine form, because associating a transition with an output feels much easier for me.)In your case, the output at each state is described by m.Let's create a table of the effect on entering a state, and the output a state generates, first:$$\begin{array}{c|c|c}\text{State} & \text{new } X & m \\\hline\text{INIT} & 0 & 0 \\\hline\text{WAIT} & D & 0 \\\hline\text{MOVE} & X & X/2 \\\hline\text{UPDT} & X-1 & X/2 \\\end{array}$$When entering a new state, you consider the row corresponding to that state only. You look up the output, m, and then update X to the value shown in the new X column.Let's create a table for the transitions:$$\begin{array}{c|c|c}\text{From} & \text{Condition} & \text{To} \\\hline\text{INIT} & ~ & \text{WAIT} \\\hline\text{WAIT} & X = 0 & \text{WAIT} \\\text{WAIT} & X \ne 0 & \text{MOVE} \\\hline\text{MOVE} & X = 0 & \text{WAIT} \\\text{MOVE} & X \ne 0 \text{ and } p = 0 & \text{MOVE} \\\text{MOVE} & X \ne 0 \text{ and } p \ne 0 & \text{UPDT} \\\hline\text{UPDT} & ~ & \text{MOVE} \\\end{array}$$From this table, you choose a row that matches the current state in the From column, and fulfills the Condition (using the (new) X and current input p). The To column on that row then tells you the next state.To create a timeline, you still need to know p and D. The diagram does not describe how they change as a function of time. When you have them as a function of time – remember, they are purely inputs to this state machine; the state machine does not affect them at all, it only examines them at specific times –, you can use the above two tables to construct the full timeline: state, X, and output m, for each clock cycle.The important thing is to remember that since this is a Moore machine, the output m is set in the state (as opposed to when transitioning as for Mealy machines); then you update X, and finally check what the next state is.