Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

aw the diagram for a finite state machine that detects whether or not a received message is valid. Characters / bytes ( of which we

aw the diagram for a finite state machine that detects whether or not a received message is valid. Characters/bytes (of which we can receive any possible value) are received one at a time and valid messages begin with the character 'T' followed by the character 'S' and end with the character 'T' followed by the character 'E'. Since messages can contain any and all possible values they can, of course, contain 'T' bytes. All such 'T's within a message will be received as two (2) consecutive 'T' bytes (thus differentiating themselves from 'TS' and 'TE'). So, if you receive two 'T' characters that indicates a single 'T' in the actual message.
Your machine will ignore bytes until a 'T' followed by an 'S' is received. Upon receiving the 'S' it will initialize a sum to zero (0). Now your machine must look for a 'T', taking all other bytes and adding them to the sum (we're computing a simple checksum). On receiving a 'T', one of the following occurs (hint: these are separate transitions):
If the next byte is another 'T', add 'T' to the sum and continue to receive bytes,
If the next byte is an 'E' and the sum is zero (0), indicate a valid message,
If the next byte is an 'E' and the sum is not zero (0), indicate a corrupt message, or
If the next byte is not an 'E' and is not a 'T', indicate a corrupt message.
For cases 2,3, and 4, return to waiting for the start of a new message.
This finite state machine has an initial state but no terminating states. Outputs/actions should be included on transitions. As an example, the label S|sum=0 would indicate that the machine is transitioning on input 'S' and the action is to set the sum to zero. If there is no action to be performed (e.g. the sum is not being changed/set), use the action None. Finally, note that your states do not require labels and not including a sum value test as part of a transition's input label implies "don't care" (or, more accurately, all values of sum). Both of these exceptions simply allow for your diagram to be less cluttered.

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago