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

Question 4: (20 points) Design a State Machine that has three input signals: N,

ID: 3729432 • Letter: Q

Question

Question 4: (20 points) Design a State Machine that has three input signals: N, D, and Q, and one output signal E. This machine will be the logic for a stamp dispenser, which accepts nickels, dimes, and quarters (only one signals can be 1 at a time. eject) signal out, which Whenever 30 cents (or more) has been entered into the machine, it sets the E ( will dispense one stamp. Note that the device does not give change, but if there is more than 30 cents registered in the state machine whena next stamp. You can do this either as a Moore or a Mealy machine, and its probably best to display this in chart form.

Explanation / Answer

Here 0 is start state.

Input = {N=5,D=10,Q=25}

Output={E=0,1} ,0 for not eject,1 for eject.

Set of states={0,5,10,15,20,25} ,where each state represent the amount of money accumulated till now.If it becomes 30 then we didn't make a separate state but goto state 0 means one stamp dispensed(E=1) successfully.

If amount >30 , E=1(dispense stamp) and we calculated rem=amount%30 and goto corresponding state for that rem.

Ex-If we got 35(for ex- 25(Q)+10(D)) then we dispensed a stamp (E=1) and remainder=35%30=5 and goto state 5.Where this 5 will be used for next stamp dispense.Similarly for 40,45,50.For 30,exact amount entered so,E=1 and goto state 0.

Curreent State Input(N/D/Q) Next State Output(E) 0(start state) N 5 0 0 D 10 0 0 Q 25 0 5 N 10 0 5 D 15 0 5 Q 0 1 10 N 15 0 10 D 20 0 10 Q 5 1 15 N 20 0 15 D 25 0 15 Q 10 0 20 N 25 0 20 D 0 1 20 Q 15 1 25 N 0 1 25 D 5 1 25 Q 20 1
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote