The following Finite State Machine (FSM) is used to detect a particular pattern in the input data stream. Whenever the pattern is matched at the input, the output is set to ‘1’, or else output is cleared to ‘0’. For which of the following data stream, output goes to ‘1 twice?
The following Finite State Machine (FSM) is used to detect a particular pattern in the input data stream. Whenever the pattern is matched at the input, the output is set to ‘1’, or else output is cleared to ‘0’. For which of the following data stream, output goes to ‘1 twice? Correct Answer 0011011010010101
Concept:
The basic idea of an FSM is to store a sequence of different unique states and transition between them depending on the values of the inputs and the current state of the machine.
A Finite State Machine (FSM) formulation is used to describe the processes during which information or tasks move from one state to another for action, according to a set of rules.
The FSM can be of two types:
- Moore (where the output of the state machine is purely dependent on the state variables) and
- Mealy (where the output can depend on the current state variable values AND the input values).
The general structure of an FSM is shown in Figure
[ alt="F1 Tapesh 14.12.20 Pallavi D2" src="//storage.googleapis.com/tb-img/production/20/12/F1_Tapesh_14.12.20_Pallavi_D2.png" style="width: 416px; height: 250px;">
The state diagrams of Mealy and Moore are shown below for an example.
Mealy
[ alt="F1 Tapesh 14.12.20 Pallavi D3" src="//storage.googleapis.com/tb-img/production/20/12/F1_Tapesh_14.12.20_Pallavi_D3.png" style="width: 224px; height: 137px;">
Moore FSM
[ alt="F1 Tapesh 14.12.20 Pallavi D4" src="//storage.googleapis.com/tb-img/production/20/12/F1_Tapesh_14.12.20_Pallavi_D4.png" style="width: 341px; height: 127px;">
Analysis:
The given FSM is Mealy and the analysis is explained below with the help of the table.
|
Present state |
Input |
Next state |
Output |
|
S0 |
0 |
S0 |
0 |
|
|
1 |
S1 |
0 |
|
S1 |
0 |
S0 |
0 |
|
|
1 |
S2 |
0 |
|
S2 |
0 |
S3 |
0 |
|
|
1 |
S2 |
0 |
|
S3 |
0 |
S0 |
0 |
|
|
1 |
S1 |
1 |
From the table, it is clear that the given FSM follows sequence 1101.
The state change is mentioned with bold letters for the respective input.
Conclusion
In option 3 the pattern is followed two times so it will give the output ‘1’ twice.