Sie sind auf Seite 1von 2

University of Management Technology School of Science and Technology, Department of Electrical Engineering EE327 - Digital System Design Fall 2011 Assignment 4 Section A

Deadline: 02-01-2012

Marks: 100

INSTRUCTIONS:

This assignment will comprise 5% of your total grade.

The deadline (02-01-2012) will not be extended.

Each student has to submit (via email to me (nauman.shahid@umt.edu.pk)) the verilog code (.v file) and testbench waveform showing the respective outputs related to each question.

Email all your files in a single zipped folder with the name in format: “ID-SecA-A4”. Use the same format for the subject of email. STRICTLY: Do not write greetings/anything in the email body. Email body will be ignored. Students writing about their incomplete assignments will be given a 0.

Consult your text-book “Advanced Digital Design using Verilog HDL” for any help in verilog programming.

Plagiarism: No two students can have a similar verilog code. In case of any copying, both students will be given ’F’ grade in the course.

1. The objective of this question is to develop a ’soft-drink dispensing machine’ in verilog HDL equivalent, using a Moore state machine implementation. A soft-drink dispensing ma- chine is one that can dispense from a selection of pre-filled drinks. Depending on the total cash entered into the machine as well as the choice (for the drinks) selected, the machine will put out a can of each type of drink selected. Ideally you should use an FSM (finite state machine) structure to implement this design.

The dispensing machine accepts Rs.1, Rs.2, Rs.4 and Rs.8 only. It dispenses only three types of drinks: Dew (costing Rs.3), Pepsi (costing Rs.4) and Sprite (costing Rs.5).

Following is a list of inputs available at the machine.

Reset: Pressing it takes the machine to ’IDLE’ state.

Rs.1: Signal is ’1’ when the Rupee 1 is entered.

Rs.2: Signal is ’1’ when the Rupee 2 is entered.

Rs.4: Signal is ’1’ when the Rupee 4 is entered.

Rs.8: Signal is ’1’ when the Rupee 8 is entered.

Dew: Signal is ’1’ when the Dew drink is entered.

Pepsi: Signal is ’1’ when the Pepsi drink is entered.

Sprite: Signal is ’1’ when the Sprite drink is entered.

Enter: Once the money is entered and drink is selected, asserting this input tells the machine to put out the requested drink as well as the remaining change.

Following is a list of outputs available at the machine.

Total Money Deposited: A 7-segment display shows the total money deposited in decimal at run-time.

Change: A set of 4-LEDs puts out the change in binary, for the user when ’Enter’ input is asserted. If no drink is selected after money has been entered, then pressing ’Enter’ returns the entire cash back to the customer.

Dispensed item: The selected drink is put out by the machine when ’Enter’ input is asserted.

The machine also has a ’reset’ input, pressing the ’reset’ will take the machine to ’IDLE’ state.

Draw very neatly the Moore state machine diagram for this question (submit in class).

Draw the corresponding current-next state table for this question (submit in class).