Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Draw a finite state machine (FSM) for a string representing a single time of day. Your FSM should accept times such as 12:36 pm,

a) Draw a finite state machine (FSM) for a string representing a single time of day. Your FSM should accept times such as 12:36 pm, 1:59 am, 4:00 pm, 2:45 am. Note that there are no leading zeros. Also, "am" and "pm" are lowercase and hace no periods. A terminal error state is not neccesary. To make the task easier, you can make up any grouping you want. For example, you may wish to leat represent any digit, let represnt the digit 1, let represent and digit 0-2, and let represent a space. Time statements are formatted in many ways but we want your FSM to only accept the above time format -- not military time or any other time format.

b) Give a regular expression for your FSM.

image text in transcribed

3. Draw a finite state machine (FSM) for a string representing a single time of day. Your FSM should accept times such as: 12:36 pm 1:59 am 4:00 pm 2:45 am Note that there are no leading zeros. Also, am and pm are lowercase and have no periods. A terminal error state is not necessary To make the task easier, you can make u grouping you want. For example, you may wish to let represent any digit, let represent the digit 1, let represent any digit 0 through 2, and let represent a space p any Time statements are formatted in many ways, but we want your FSM to only accept the above time format not military time or any other time format. PAUE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions