0% found this document useful (0 votes)
168 views

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

Here is a state transition diagram for the turnstile with valid and invalid ticket inputs: States: Locked, Ticket Inserted, Unlocked Inputs: Valid Ticket, Invalid Ticket Locked + Valid Ticket → Ticket Inserted Ticket Inserted + Pass → Unlocked Unlocked + Pass → Locked Ticket Inserted + Invalid Ticket → Locked So the turnstile will only transition from the Locked state to the Ticket Inserted state if a valid ticket is inserted. An invalid ticket will just return it directly to the Locked state without allowing passage.

Uploaded by

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

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

Here is a state transition diagram for the turnstile with valid and invalid ticket inputs: States: Locked, Ticket Inserted, Unlocked Inputs: Valid Ticket, Invalid Ticket Locked + Valid Ticket → Ticket Inserted Ticket Inserted + Pass → Unlocked Unlocked + Pass → Locked Ticket Inserted + Invalid Ticket → Locked So the turnstile will only transition from the Locked state to the Ticket Inserted state if a valid ticket is inserted. An invalid ticket will just return it directly to the Locked state without allowing passage.

Uploaded by

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

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

For the FSM above which of these inputs are valid:

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

Draw a finite state automata that will accept the words:

 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:

Input Current State Next State Output

0 S1 S2 null

1 S1 S1 null

0 S2 S1 null

1 S2 S3 null

Q.6

Create a state transition table for the following FSM:


Q.7

Create a state transition table for the following FSM:


Q.8

Draw the FSM for the following state transition table:

Input Current State Next State Output

Timer Green Green null

Button Green Yellow null

Timer Yellow Red null

Timer Red Green null

Answer:
Q.9

raw the FSM for the following state transition table:

Input Current State Next State Output

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

A turnstile is used to control access to a railway platform.

It can be in one of two states: locked or unlocked.

Inserting a ticket unlocks the turnstile, allowing a single customer to pass through.

The arms are locked again until another coin is inserted.

Question

Is the ticket valid?

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?

There will be a third state – ticket inserted

You might also like