01 Finite State Machine 1
01 Finite State Machine 1
01 Finite State Machine 1
Activity Kind
Small group exercise
Purpose
The purpose of this exercise is to build upon what has been learned in the video and to practice using
and reasonable about these formalisms in order for each student to be better positioned to actually
employ them on projects appropriately.
Pre-requisite
Students are expected to have complete Finite State Machine Exercise from the previous day as well
as watched the Video - Finite State Machine floating point value recognizer (13:55).
Tasking
Students are partitioned in to groups of two to four students. Each small group studies the following
finite state machine and works together to answer the follow following questions.
Deliverable
Each student is responsible for producing a solution to this exercise. Do not just provide the answer
the group produced if you do not believe it is correct.
Submission
The students must produce and submit the following answer page prior to the start of the next activity
or exercise.
0-9 0-9
.
1 2
6
0-9
E, e E, e
0 0-9
.
0-9 E, e 0-9
3 4
6 5 7
6
0-9
+, -
0-9
6
.
Study the finite state machine on the previous page. This machine accepts strings of numeric digits
(from 0 through 9, letters e and E, and symbols + and -).
1. Given the string “1.32E4”, list the sequence of states and specify if the string is accepted.
2. Given the string “.24e-”, list the sequence of states and specify if the string is accepted.
3. Given the string “0.125”, list the sequence of states and specify if the string is accepted.
4. Given the string “0.125-3”, list the sequence of states and specify if the string is accepted.
5. Explain why this FSM needs both states 1, 2, and 3 and 4 and 5. What different situations are
covered by these two parts of the FSM?