0% found this document useful (0 votes)
15 views9 pages

Unit 5 Notes DLD

Uploaded by

dir.training
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views9 pages

Unit 5 Notes DLD

Uploaded by

dir.training
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

FSM Capabilities

Finite state machines (FSMs) have several capabilities, including:


 Modeling problems
FSMs can represent systems where specific inputs cause specific state
changes. They can be used to model problems in many fields, including artificial
intelligence, mathematics, linguistics, and games.
 Simulating sequential logic
FSMs can represent and control execution flow by simulating sequential logic.
 Controlling systems
FSMs can be used to model and control systems with discrete and sequential
behavior. Some examples of these systems include digital circuits, software
protocols, user interfaces, and robotic systems.
 Easy to understand and implement
FSMs are easy to understand and implement.
 Graphical representation
FSMs are usually represented as a graph, with a finite number of nodes and
arcs. The nodes describe the system's possible states, and the arcs represent
transitions that change or do not change the state.
A simple example of an FSM is a vending machine, which requires certain
conditions to be satisfied before it operates.

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.

Difference Between Mealy Machine And


Moore Machine
Parameters Mealy Machine Moore Machine

Definition A Mealy Machine changes its A Moore Machine’s output depends


output on the basis of its present only on the current state. It does not
state and current input. depend on the current input.

Output Mealy Machine places its output Moore machine also places its output
on the transition. on the transition.

States It has comparatively fewer or the It has comparatively fewer or the


same states as that of the Moore same states as that of the Mealy
machine. machine.

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.

Reaction to the A Mealy machine reacts In a Moore Machine, one requires


Inputs comparatively faster to inputs more logic for decoding the output. As
than the Moore machine. a result, it leads to more delays in the
Generally, it reacts in the very circuit. Generally, these react after
same clock cycle. one clock cycle.

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.

Design The designing process doesn’t It is very easy to design.


need to be very easy.

Example 1:
Convert the following Mealy machine into equivalent Moore machine.

Solution:

Transition table for above Mealy machine is as follows:


o For state q1, there is only one incident edge with output 0. So, we
don't need to split this state in Moore machine.

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:

Transition table for above Mealy machine is as follows:

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).

Transition table for Moore machine will be:


Transition diagram for Moore machine will be:

You might also like