FSM Q.1: For The FSM Above Which of These Inputs Are Valid: 1. Aaacdb 2. Ababacdaaac 3. Abcdb 4. Acda 5. Acdbdb Q.2
FSM Q.1: For The FSM Above Which of These Inputs Are Valid: 1. Aaacdb 2. Ababacdaaac 3. Abcdb 4. Acda 5. Acdbdb Q.2
Q.1
1. aaacdb
2. ababacdaaac
3. abcdb
4. acda
5. acdbdb
Q.2
1. 987654321+994-0
2. 5-5+2*4
3. 9+8+7+6+5+4+3+2+1
4. 0+1+2+1+
5. 99+88-77
Q.3
Draw a finite state automata that will accept the word Banana whilst using only 3 states.
Q.4
Tim
Grit
Grrrrrim
Some FSMs output values dependent on the state and the input values:
The above Mealy Machine outputs a value for each input. You can tell which is which by: input / ouput.
So for the following input:
000101010
It outputs
000010101
Shifting all the bits right, and dividing the binary number input by two.
Q.5
For the Mealy machine above, what do the following inputs output:
1. 50
2. 20,10,20
3. 10,10,10,20
What does this machine do, what do the outputs tell you?
State transition tables
A state transition table follows every state and input. Inputs are usually placed on the left, and
separated from the outputs, which are on the right. Here's a simple example of a state machine with
two states, and a binary input:
0 S1 S2 null
1 S1 S1 null
0 S2 S1 null
1 S2 S3 null
Q.6
Answer:
Q.9
a q0 q0 null
b q0 q1 null
a q1 q2 null
b q1 q1 null
a q2 q1 null
b q2 q1 null
Answer:
What is a finite state machine?
It is not a “machine” in the sense of some physical, mechanical thing with moving parts.
It is an abstract representation of how something changes from one state to another in response to a
condition or event.
Example: a turnstile
Inserting a ticket unlocks the turnstile, allowing a single customer to pass through.
Question
Suppose the turnstile will not accept any ticket – it has to be a valid one for the journey
Can you draw a new state transition diagram with two extra inputs: valid ticket and invalid ticket?