homework 6 solution

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

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

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.

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

View Full Document
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).
8/24/2009 Homework #6 – Solution – Page 3 of 30 2. A listing of all valid output combinations (based on the spec above).

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## 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
Ask a homework question - tutors are online