0% found this document useful (0 votes)
36 views14 pages

Transition Matrix

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

Transition Matrix

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

Presentation by-

Aviral Sharma &


Ayush Kumar Mishra
Topics Covered
◦FSM
◦State Diagram
◦State table
◦Transition matrix
◦Examples of transition matrix
Finite state machine (FSM)
A Finite State Machine (FSM) is a computational model that
consists of a limited number of specific states, transitions
between those states, and actions associated with various state
changes. An FSM processes a sequence of inputs that cause it
to change from one state to another according to defined
transition rules. Essentially, an FSM can be described simply as
a system that moves through a predetermined sequence of
states, based on external events, in a manner specific to its
designed behavior.
State Diagram
◦ A state diagram is a visual representation of a finite state machine (FSM). It uses circles to
represent the states of the system and arrows to show the transitions between these states.
Each arrow is typically labeled with a condition or input that causes the FSM to move from
one state to another.
◦ State diagrams provide a clear and immediate visual understanding of how an FSM operates.
By seeing the states and transitions laid out graphically, it's easier to comprehend the
overall flow and operation of the system. This visual representation helps in quickly
identifying how the system reacts to different inputs.
◦ During the design phase, state diagrams make it easier to conceptualize and structure the
FSM. Designers can visually map out the states and transitions, making it easier to spot
errors such as missing transitions or unreachable states.
◦ By providing a visual layout of all states and transitions, state diagrams allow developers and
testers to analyze the FSM's behavior comprehensively. They can use the diagram to ensure
all paths are tested and to check the logic of state transitions under various scenarios.
Let’s take an Example of State
Diagram

State Diagram for Traffic


Light
State table
◦ A state table is a structured way to describe a finite state machine (FSM) by listing
all possible states it can be in, the inputs it might receive, and the resulting states it
transitions to based on those inputs. Essentially, it's a tabular representation that
maps each combination of current state and input to a specific next state.
◦ It ensures that every possible state and input combination is considered. This
thoroughness is crucial for complex systems to make sure nothing is overlooked,
which can prevent bugs and errors in system behavior.
◦ By having a clear, tabular layout of transitions, a state table allows for
straightforward analysis of the FSM. You can easily see which inputs cause
transitions between states, helping to debug, test, and verify the FSM.
State Table for Traffic light
Current State Input Next State
Green(G) 0 Green(G)
Green(G) 1 Yellow(Y)
Yellow(Y) 0 Yellow(Y)
Yellow(Y) 1 Red(R)
Red(R) 0 Red(R)
Red(R) 1 Green(G)
Transition Matrix
◦ A transition matrix is a grid that shows how a finite state machine (FSM) moves
from one state to another based on certain inputs. Each row in the matrix
represents the current state, and each column represents an input. The value in
each cell shows the next state that the FSM will transition to when that input is
received in the current state.
◦ A transition matrix organizes the state transitions in a clear and compact way. It’s
like a table that shows all possible moves between states based on inputs, making
it easy to understand how the FSM behaves.
◦ It helps when designing or programming the FSM because you can directly see how
the machine should respond to each input in every state.
Example
Input=0 Input=1
Green(G) Green(G) Yellow(Y)
Yellow(Y) Yellow(Y) Red(R)
Red(R) Red(R) Green(G)
Relation between State Diagram,
State Table and Transition Matrix

State State Transition


Diagram Table Matrix

Sequence
Another Example:
Transition matrix
Current Floor Input=0 (Down) Input=1 (Up)
Floor 1 Floor 1 Floor 2
Floor 2 Floor 1 Floor 3
Floor 3 Floor 2 Floor 3

You might also like