Construct a finite state machine that models a vending machine accepting only quarters that dispenses a container of orange juice when $.50 has been deposited, followed by a button being pushed. (The possible inputs are quarters and the button, and the possible outputs are nothing, orange juice, and a quarter. The machine returns any extra quarters.)
Construct a finite state machine that models a vending machine accepting only quarters that dispenses a container of orange juice when $.50 has been deposited, followed by a button being pushed. (The possible inputs are quarters and the button, and the possible outputs are nothing, orange juice, and a quarter. The machine returns any extra quarters.)
Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
Related questions
Question

Transcribed Image Text:### Constructing a Finite State Machine for a Vending Machine
**Problem Statement:**
Construct a finite state machine that models a vending machine accepting only quarters that dispenses a container of orange juice when $0.50 has been deposited, followed by a button being pushed. The possible inputs are quarters and the button, and the possible outputs are nothing, orange juice, and a quarter. The machine returns any extra quarters.
**Inputs:**
- Quarters ($0.25 each)
- Button press
**Outputs:**
- Nothing
- Orange juice
- A quarter
**Behavior:**
- The machine dispenses a container of orange juice once $0.50 has been deposited and the button is pushed.
- Any extra quarters inserted are returned by the machine.
To model this, we will consider the following states:
1. **S0:** Initial state, no quarters inserted.
2. **S1:** $0.25 inserted.
3. **S2:** $0.50 inserted.
4. **S3:** Accept button press and dispense orange juice.
**Transitions:**
1. **S0:**
- On quarter input: move to S1 (balance = $0.25)
- On button input: remain in S0 (no action)
2. **S1:**
- On quarter input: move to S2 (balance = $0.50)
- On button input: remain in S1 (no action)
3. **S2:**
- On quarter input: remain in S2 (return quarter because balance exceeds $0.50)
- On button input: move to S3 (dispense orange juice)
4. **S3:**
- On any input (either quarter or button press): return to S0 (reset state)
**Transitions Table:**
| Current State | Input | Next State | Output |
|---------------|-----------|------------|-------------------------------|
| S0 | Quarter | S1 | Nothing |
| S0 | Button | S0 | Nothing |
| S1 | Quarter | S2 | Nothing |
| S1 | Button | S1 | Nothing |
| S2 | Quarter | S2 | Return quarter |
| S2 | Button | S3 | Dispense orange juice |
| S3 | Quarter
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images

Recommended textbooks for you

Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated

Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education

Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY

Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated

Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education

Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY

Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,

