Docsity

Soda Dispense Circuit Design: Behavioral and Structural Implementation - Prof. Susan Lysec, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 474a/574a
Programming Assignment 4 (25 points)
Due November 6, 2006 (Monday) at 8:00 pm
Deliverables
• Datapath – behavioral implementation of various datapath components, structural implementation of the datapath itself
• Controller – behavioral implementation describing the internal states, transitions, and the corresponding state actions to control
the corresponding datapath
• Circuit Soda_Dispense – structural implementation of the interconnection between the datapath and controller
• Testbench - a robust testbench to verify the proper functionality of the Soda_Dispense circuit
Turnin
• Submit your project using electronic turnin, class_account_name is “ece474a”, assignment_name is “assign4”
Project Description
Implement a soda dispenser. The cost of the soda is 75 cents. Your machine will accept quarters, dimes, and nickels. As the user feeds
coins into the machine you will need to keep track of how much money was inserted. Once you have collected at least 75 cents, you will
release a single soda. You will also need to output how much change the machine should return. You do not need to compute the number of
quarter, dimes, and nickels to return, rather just an 8-bit value indicating the correct change (i.e. if the user inserts 80 cents, change = 5).
Once the soda has been dispensed, your circuit will start over and wait for additional coins.
The system interface is as follows:
• quarter – bit input, indicates the user has inserted 25 cents into the soda machine
• dime – bit input, indicates the user has inserted 10 cents into the soda machine
• nickle – bit input, indicates the user has inserted 5 cents into the soda machine
• soda_release –bit output, when enabled (set to 1) releases a soda.
• change – 8-bit output, indicates the amount of change to return
The design of Soda_Dispense should be divided into 2 parts - a controller and a datapath. The controller is an FSM which issues commands
to the datapath based on the current state and the external inputs. This should be a behavioral description. The datapath contains a netlist of
functional units like multiplexors, registers, adders, and comparators, and hence this design is structural.
ECE 574 A ONLY – Extend your implementation to provide the user with a choice between two drinks, soda and water. The soda costs 75
cents, while the water costs one dollar. The user presses a button corresponding to the desired drink. If the user selects a soda, input soda
will be high. If the user selects water, input water will be high. If the user presses both buttons, soda has the priority. Additionally, if the
user presses either button indicating the desired drink selection but not enough money has been inserted, the n_enough output will go high
until presses another button or enters more money.
Soda_Dispense
soda_release
change
nickel
quarte
r
dime
rs
t
cl
k
8
Soda_Dispense
soda_release
nickel
quarte
r
dime
rs
t
cl
k
sod
a
wate
r
change
8 n_enough

Partial preview of the text

Download Soda Dispense Circuit Design: Behavioral and Structural Implementation - Prof. Susan Lysec and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECE 474a/574a

Programming Assignment 4 (25 points)

Due November 6, 2006 (Monday) at 8:00 pm

Deliverables

  • Datapath – behavioral implementation of various datapath components, structural implementation of the datapath itself
  • Controller – behavioral implementation describing the internal states, transitions, and the corresponding state actions to control the corresponding datapath
  • Circuit Soda_Dispense – structural implementation of the interconnection between the datapath and controller

• Testbench - a robust testbench to verify the proper functionality of the Soda_Dispense circuit

Turnin

  • Submit your project using electronic turnin, class_account_name is “ece474a”, assignment_name is “assign4”

Project Description

Implement a soda dispenser. The cost of the soda is 75 cents. Your machine will accept quarters, dimes, and nickels. As the user feeds coins into the machine you will need to keep track of how much money was inserted. Once you have collected at least 75 cents, you will release a single soda. You will also need to output how much change the machine should return. You do not need to compute the number of quarter, dimes, and nickels to return, rather just an 8-bit value indicating the correct change (i.e. if the user inserts 80 cents, change = 5). Once the soda has been dispensed, your circuit will start over and wait for additional coins.

The system interface is as follows:

  • quarter – bit input, indicates the user has inserted 25 cents into the soda machine
  • dime – bit input, indicates the user has inserted 10 cents into the soda machine
  • nickle – bit input, indicates the user has inserted 5 cents into the soda machine
  • soda_release –bit output, when enabled (set to 1) releases a soda.
  • change – 8-bit output, indicates the amount of change to return

The design of Soda_Dispense should be divided into 2 parts - a controller and a datapath. The controller is an FSM which issues commands to the datapath based on the current state and the external inputs. This should be a behavioral description. The datapath contains a netlist of functional units like multiplexors, registers, adders, and comparators, and hence this design is structural.

ECE 574 A ONLY – Extend your implementation to provide the user with a choice between two drinks, soda and water. The soda costs 75 cents, while the water costs one dollar. The user presses a button corresponding to the desired drink. If the user selects a soda, input soda will be high. If the user selects water, input water will be high. If the user presses both buttons, soda has the priority. Additionally, if the user presses either button indicating the desired drink selection but not enough money has been inserted, the n_enough output will go high until presses another button or enters more money.

Soda_Dispense

soda_release

change

nickel

quarter dime

rst clk

8

Soda_Dispense

soda_release

nickel

quarter dime

rst clk

soda water

change 8 n_enough