Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this task, you will design a FSM for a simple (albeit strange) vending machine of office supplies. The vending machine sells three possible items,
In this task, you will design a FSM for a simple (albeit strange) vending machine of office supplies. The vending machine sells three possible items, each at a different cost: Item Cost Pencil 10 cents Eraser 20 cents Pen cen The vending machines accepts nickels (worth 5 cents), dimes (worth 10 cents), and quarters (worth 25 cents). Physically, it is only possible to insert a single coin at a time. The vending machine features a large button labeled "DONE", which, when pressed, will dispense the most expensive item which can be purchased with the input money. For example, if a dime and two nickels had been entered totaling 20 cents then it would dispense an eraser upon pressing DONEOnce an item is dispensed, the vending machine returns to an initial state wherein it shows that no money has been inserted. To help simplify things, the vending machine does not provide any change. This means that any additional money provided will be lost. For example, if a quarter had been entered and then "DONE pressed, the vending machine would dispense an eraser (because this is the most expensive item which can be purchased with 25 cents), and then the vending machine would return to the point where it shows that no money has been entered. As another example, if two quarters had been entered, then upon pressing "DONE", it would dispense a pen (the most expensive item purchasable with 50 cents), and then the vending machine would return to the point where it shows that no money has been entered. While there are different ways to model these different parameters as inputs, your FSM should deal with the following inputs Description Input K Set to 1 if a nickel has been entered, else o D Set to 1 if a dime has been entered, else o QSet to 1 if a quarter has been entered, else o E Set to 1 if "DONE" has been pressed, else o In addition to the above inputs, you'll also need to specify what the current state is, which should be indicated with inputs co through cs, where s is the position of the greatest possible bit in your state encoding. For example, if you needed eight states in your FSM, then you'd have inputs co, c1, and c2, as eight states can be uniquely encoded using three bits. Similarly to the inputs, the output parameters can be modeled in different ways. However, for the sake of consistency across different solutions, your FSM should deal only with the following outputs Output DPENCIL Short for "Dispense Pencir. Set to 1 if we should dispense a pencil, else o DERASER|Short for "Dispense Eraser". Set to 1 if we should dispense an eraser, else 0 DPEN Description Short for "Dispense Pen". Set to 1 if we should dispense a pen, else o In addition to the above outputs, you'll also need to specify what the next state is, which should be indicated with outputs Ho through , where w is the position of the greatest possible bit in your state encoding. For example, if you needed eight states in your FSM, then you'd have inputs so, N1, and N2, as eight states can be uniquely encoded using three bits. In this task, you will design a FSM for a simple (albeit strange) vending machine of office supplies. The vending machine sells three possible items, each at a different cost: Item Cost Pencil 10 cents Eraser 20 cents Pen cen The vending machines accepts nickels (worth 5 cents), dimes (worth 10 cents), and quarters (worth 25 cents). Physically, it is only possible to insert a single coin at a time. The vending machine features a large button labeled "DONE", which, when pressed, will dispense the most expensive item which can be purchased with the input money. For example, if a dime and two nickels had been entered totaling 20 cents then it would dispense an eraser upon pressing DONEOnce an item is dispensed, the vending machine returns to an initial state wherein it shows that no money has been inserted. To help simplify things, the vending machine does not provide any change. This means that any additional money provided will be lost. For example, if a quarter had been entered and then "DONE pressed, the vending machine would dispense an eraser (because this is the most expensive item which can be purchased with 25 cents), and then the vending machine would return to the point where it shows that no money has been entered. As another example, if two quarters had been entered, then upon pressing "DONE", it would dispense a pen (the most expensive item purchasable with 50 cents), and then the vending machine would return to the point where it shows that no money has been entered. While there are different ways to model these different parameters as inputs, your FSM should deal with the following inputs Description Input K Set to 1 if a nickel has been entered, else o D Set to 1 if a dime has been entered, else o QSet to 1 if a quarter has been entered, else o E Set to 1 if "DONE" has been pressed, else o In addition to the above inputs, you'll also need to specify what the current state is, which should be indicated with inputs co through cs, where s is the position of the greatest possible bit in your state encoding. For example, if you needed eight states in your FSM, then you'd have inputs co, c1, and c2, as eight states can be uniquely encoded using three bits. Similarly to the inputs, the output parameters can be modeled in different ways. However, for the sake of consistency across different solutions, your FSM should deal only with the following outputs Output DPENCIL Short for "Dispense Pencir. Set to 1 if we should dispense a pencil, else o DERASER|Short for "Dispense Eraser". Set to 1 if we should dispense an eraser, else 0 DPEN Description Short for "Dispense Pen". Set to 1 if we should dispense a pen, else o In addition to the above outputs, you'll also need to specify what the next state is, which should be indicated with outputs Ho through , where w is the position of the greatest possible bit in your state encoding. For example, if you needed eight states in your FSM, then you'd have inputs so, N1, and N2, as eight states can be uniquely encoded using three bits
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