Problem 2
a) Truth table for the finite-state machine:
Input Current State Next State
0
Start
A
1
A
B
0
B
A
1
B
A
b) Required to Define the Finite-State Machine:
• States:
o The States in this Finite-State Machine are “ A, B and Start.”
• Inputs:
o "h," the input for this finite-state machine, can take one of two possible values: 0 or
1.
• Output:
o Given that no specific outputs are stated in the description, we can infer that this
finite-state machine has no outputs.
• Transitions:
o Start -> A (input 0)
o A -> B (input 1)
o B -> A (Input 0)
o B -> A (input 1)
c) Using MATLAB, let’s simulate this finite state Machine:
We can determine the state sequences as follows:
Input Sequence 1: 1, 1, 0, 0, 1, 1, 0, 0
State sequence: start -> A -> B -> A -> B -> A -> B -> A
Input Sequence 2: 0, 1, 0, 1, 0, 1, 0, 1
State sequence: start -> A -> B -> A -> B -> A -> B -> A
The same outcomes of the simulation and the analytical analysis of state sequences validate the
accuracy of the simulation.