homework 6 solution

homework 6 solution - ECE 152A Summer 2009 8/24/2009...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 152A – Summer 2009 8/24/2009 Homework #6 – Solution – Page 1 of 30 University of California, Santa Barbara Department of Electrical and Computer Engineering ECE 152A – Digital Design Principles Homework #6 – Solution Problem #1. In this problem you are to design a controller for a vending machine that dispenses 37¢ stamps. The machine accepts only quarters and a maximum of 3 quarters can be inserted (at which time the machine will deliver stamps, change and reset itself to the initial state). Inputs to the machine are Q (quarter) indicating a quarter has been deposited, S (stamp) indicating that the user wants stamps delivered and C (cancel) indicating that the user wants to cancel the transaction and have his money returned. If the S (stamp) input is detected and 50¢ has been deposited, the machine should deliver a single 37¢ stamp (and the change described below). If the S (stamp) is detected before 50¢ has been deposited, an error (ERR) signal is generated. A two bit output from the controller indicates how many stamps should be delivered (STMP1, STMP0). After delivering the stamps, the machine should return to the initial state. The machine returns only nickels for change; any additional (single penny) change is returned in the form of 1¢ stamps. A two bit output (NCK1, NCK0) indicates the number of nickels to be returned. A two bit output (PNY1, PNY0) indicates how many 1¢ stamps to deliver. If at any time the C (cancel) signal is detected a coin return (CR) signal is generated causing the contents of the coin box to be emptied and the machine to be reset to the initial state. The cancel/coin return operation has the highest priority and should be executed regardless of the value of S and Q. Also, assume that S (stamp) and Q (quarter) can never be exerted simultaneously.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ECE 152A – Summer 2009 8/24/2009 Homework #6 – Solution – Page 2 of 30 Design the controller as a Moore machine and include the following: 1. A listing of all valid input combinations (based on the spec above).
Background image of page 2
8/24/2009 Homework #6 – Solution – Page 3 of 30 2. A listing of all valid output combinations (based on the spec above).
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 30

homework 6 solution - ECE 152A Summer 2009 8/24/2009...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online