01 Finite State Machine 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Small Group Exercise: Finite State Machine Exercise 1

Lynn Robert Carter, PhD


2018-02-11

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
.

Copyright © 2018 Lynn Robert Carter. All Rights Reserved.


Software Engineering Foundations
Small Group Activity: Finite State Machine Exercise 1
This page is your answer to the exercise based on your group’s work. Provide what you believe is the
right answer, even if it differs from what the rest of the group thinks is the right answer.
After you finish filling in the answer, copy and paste the following into your ENB

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?

You might also like