Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A candy machine controller has the following constraints: Inputs: CRi—press coin

ID: 2083675 • Letter: A

Question

A candy machine controller has the following constraints: Inputs: CRi—press coin return Qi—insert a quarter coin CGi—select chewing gums PCi— select potato chips CBi—select chocolate bar Outputs: Qo—dispense a quarter coin CGo—dispense chewing gums PCo—dispense potato chips CBo— dispense chocolate bar All the products are sold at 25c. Only one (US) quarter coin is allowed to insert. Design this controller using state machine model. In this question, it is required to show all necessary steps for the design.

Explanation / Answer

Here, for the four outputs(i.e Qo, CGo, PCo, CBo) four sates are necessary and one more state is needed to display the status of candy machine that is "All products are sold at 25c" or "insert a quarter coin". So All total 5 states are necessary.

Stetes

So => starting state to display status of the machine

S1 => this state can be reached when 'CRi—press coin return' input is high

S2 => this state can be reached when 'CGi—select chewing gums' input is high

S3 => this state can be reached when 'PCi— select potato chips' input is high

S4=> this state can be reached when 'CBi—select chocolate bar' input is high

the outputs in the states are given below are shown within the circle of the state diagram

State- So-> output '000' means "All products are sold at 25c" or "insert a quarter coin" to be dispalyed

State- S1-> output '001' means Qo—dispense a quarter coin

State- S2-> output '010' means CGo—dispense chewing gums

State- S3-> output '011' means PCo—dispense potato chips

State - S4-> output '100' means CBo— dispense chocolate bar

All the states must return to S0 to display the status of the candy machine after each transaction. Below is the state digram given