Unit 5 Notes DLD
Unit 5 Notes DLD
FSM Limitations
Finite state machines (FSMs) have several limitations, including:
Limited number of states
FSMs can't model systems with an indeterminate number of states. For
example, an FSM can't accept a string of any number of 1s followed by the
same number of 0s.
Limited memory
FSMs have limited memory because of the number of states they have.
Inefficient use of resources
FSMs can be inefficient with resources, especially for machines with many
states.
Difficult to debug
FSMs with thousands of states can be difficult to debug because the main loop()
routine contains a lot of code.
Not elegant or readable
Code with thousands of if-else or switch-case statements can be difficult to read
and understand.
Cumbersome to change
Once defined, it can be difficult to change the states or transitions of an FSM.
FSMs are theoretical frameworks that can be used to model systems with a
known set of states. They can be used in many fields, including
mathematics, artificial intelligence, games, and linguistics.
Output Mealy Machine places its output Moore machine also places its output
on the transition. on the transition.
Value of the When the input logic is done in Whenever a change occurs in the
Output the present state, then the value state, the output function’s value
Function of the output function becomes a becomes the function of its current
function of transitions and state along with the changes at the
changes. edges of the clock.
State and The asynchronous generation of The state and output- both change
Output output through its state alters to the synchronous to its clock edge.
synchronous on the present
clock.
Requirement of A Mealy Machine generally The states for synthesis required for
States requires only a very few states this machine are also more.
for the process of synthesis.
Requirement of It requires very little hardware for One requires more hardware to
Hardware designing a Mealy Machine. design a Moore Machine.
Counter You cannot refer to the counter You can refer to the counter as a
as a Mealy Machine. Moore Machine.
Example 1:
Convert the following Mealy machine into equivalent Moore machine.
Solution:
o For state q2, there is 2 incident edge with output 0 and 1. So, we
will split this state into two states q20( state with output 0) and
q21(with output 1).
o For state q3, there is 2 incident edge with output 0 and 1. So, we
will split this state into two states q30( state with output 0) and q31(
state with output 1).
o For state q4, there is only one incident edge with output 0. So, we
don't need to split this state in Moore machine.
Transition table for Moore machine will be:
Transition diagram for Moore machine will be:
Example 2:
Convert the following Mealy machine into equivalent Moore machine.
Solution:
The state q1 has only one output. The state q2 and q3 have both output 0
and 1. So we will create two states for these states. For q2, two states will be
q20(with output 0) and q21(with output 1). Similarly, for q3 two states will be
q30(with output 0) and q31(with output 1).