How to derive output equations in a Mealy-type FSM?

Thread Starter

Gr10

Joined Feb 10, 2025
15
When designing the state machine, do I need to derive a separate output equation for each of the five outputs, or can I group them into the UP signals (U1, U2), the DOWN signals (D1, D2), and the NOGO signal?

Assuming this FSM is a Mealy type, what would be the structure of the truth table? That is, states encoded with outputs?





1751899589210.png
 

spenkmo

Joined Apr 24, 2025
25
There are 3 output signals, and their encodings are specified. 3 signals can represent 8 states; the figure shows that only 5 states (D1,D2,U1,U2,No-Go) have been used and their corresponding encodings defined. The 3 missing states become dont-cares. Each of the 3 output signals must have its own equation or truth-table, which, based on the Mealy model, is a function of the FSM's internal states and the 2-bit input signals. The 3-state FSM may use 2 bits for internal states (or 3 bits for one-hot encoding); so each output signal is a function of 4 binary inputs, 2 for the internal states and 2 for the inputs.
 

Thread Starter

Gr10

Joined Feb 10, 2025
15
There are 3 output signals, and their encodings are specified. 3 signals can represent 8 states; the figure shows that only 5 states (D1,D2,U1,U2,No-Go) have been used and their corresponding encodings defined. The 3 missing states become dont-cares. Each of the 3 output signals must have its own equation or truth-table, which, based on the Mealy model, is a function of the FSM's internal states and the 2-bit input signals. The 3-state FSM may use 2 bits for internal states (or 3 bits for one-hot encoding); so each output signal is a function of 4 binary inputs, 2 for the internal states and 2 for the inputs.
Thank you! But I have a question: What's the meaning of define a output's state (NoGo) if you are no to use it? Is there something wrong in the defination of the FSM. Something that I should fix it for my own?
 
Last edited:

Papabravo

Joined Feb 24, 2006
22,058
In a Mealy machine, the output is a function of the transition. In a Moore machine, the output is a function of the state. The implication of that is that in a Mealy machine the inputs and the present state determine the next state AND the outputs.
 

spenkmo

Joined Apr 24, 2025
25
The FSM probably implements something like a 3-floorplan elevator controller, with S1,2,3 representing floor 1,2 and 3. The R1,2,3 inputs decide which target floor to go to. The U1,U2,D1,D2 outputs decide which direction (U or D) and how many floors (1 or 2) to go in that direction. No-Go simply means that if R1 is chosen while at S1 (or R2 at S2, R3 at S3), then stay where you are. If this is the correct guess, then the "-" output labels in the state machine mean No-Go. Normally we use "-" for dont-care. But in this case, No-Go is not a dont-care.
 
Top