Answered step by step
Verified Expert Solution
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. Charactersbytes 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 Ts within a message will be received as two 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 Now your machine must look for a T taking all other bytes and adding them to the sum were 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 indicate a valid message,
If the next byte is an E and the sum is not zero indicate a corrupt message, or
If the next byte is not an E and is not a T indicate a corrupt message.
For cases and return to waiting for the start of a new message.
This finite state machine has an initial state but no terminating states. Outputsactions should be included on transitions. As an example, the label Ssum 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 eg the sum is not being changedset 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started