Reference no: EM132582622
ENSC252 Fundamentals of Digital Logic and Design Assignment - Simon Fraser University, Canada
Final Project - Vending Machine Controller
Objective: To design a fully functional vending machine controller (VMC) in VHDL. Students will apply their digital design knowledge and various FSM principles to implement the hardware components necessary to realize a coin operated VMC based on a set of specifications. The machine will support four modes of operation: vending mode, program mode, display mode, and free mode. Consumers will use the vending and display mode, and vending machine operators the program, display, and free mode. Distinction between consumer and user will not be necessary in the context of this project.
Note - It's a Vhdl project on Quartus prime 19.1 lit verision.
1) Vending Machine Controller Overview
The vending machine controller (VMC) is a sequential, active-high circuit. The VMC may be set to a certain mode using the "Start" input, simultaneously applied with a "funct" (Function) input code. Accordingly, the start input signal will initiate the VMC to enter the "funct" specified mode of operation. The funct mode encodings are as follows:
0) Program Mode: program the price of a given product (operator)
1) Display Mode: display the price of a product (operator/user)
2) Vending Mode: purchase the selected product (user)
3) Free Mode: dispenses the selected product for free (operator)
When the VMC is set into the vending or program mode, the user specifies the product using input "prod", and the controller thereafter accepts three types of coins: Nickels (N), Dimes (D) and Quarters (Q). The N, D, and Q coins each have their own input slot in the vending machine, and hence the coins may be input simultaneously or individually by the user. An input called "set" applied during program mode will signal to the VMC that the user has finished inserting coins.
The outputs of the VMC will present the user with an indication of how much a product costs (total0-2), the running total (runTotal0-2 i.e. coins inserted into the VMC), and change (change0-2) returned to the user. A "finished" signal will be output to the user to indicate that the operation has been successfully completed, and that the product has been dispensed (if applicable). For the sake of simplicity, we will allow our VMC to support up to four products only.
2) System Specifications
The vending machine will consist of 5 main components depending on your implementation: program_unit, sram, convert2bcd, vend_unit, and the FSM required to control the VMC's operational modes. You will be required to determine any specifications that have been purposely left out, such as port/signal datawidths and types. The rest of the implementation is up to you; you must have a justification for your design choices. The following outlines specifications for each unit:
A) Program Unit - implements the VMC's program mode
B) SRAM
We will expand our knowledge by learning how to create and interface IP (Intellectual Property) cores available in Quartus' IP Catalog into our designs. Specifically, we will use a 1-PORT RAM component for which we will store and read our product prices (required of the program and display mode). To generate a RAM IP core, carefully follow the steps provided in the Appendix. Thoroughly test your RAM core through simulations to ensure you understand how to write and read data, and integrate the component within your design.
C) Display Mode
Design choice: This mode may be implemented within the top-level vending machine, or as a separate component integrated into the VMC. When the user specifies display mode, the product specified is read from the on-chip memory. Accordingly, the product number is applied to the address input, and the read enable signal is asserted.
Once the data is read, the done signal must be asserted in sync with the read data output from the VMC system, displayed on the total0..3 output segment display. Hint: ensure you thoroughly test the memory unit before proceeding to code the display mode functionality.
D) Vending unit (vend_unit) -implements vending mode
The vend_unit implements vending mode functionality. The unit is enabled whenever enable = '1'. The price_in input provides the selected product's price which is read from memory, and therefore the FSM in the top-level (vending_machine) must ensure that all signals are synced when vend mode is activated, such that enable and price_in are aligned with respect to time. i.e. when vending_unit is enabled, price_in is reflective of the product's price.
E) Free Mode - implements free mode
Likely the simplest to implement, and a good starting point. When the free state is entered, the mode simply sets all vending_machine outputs to the floating state 'Z' and dispenses the product specified by the user, represented by the assertion of the "finished" signal. Once asserted, the vending machine re-enters the idle state, where the finished signal is unasserted.
F) Vending Machine Controller Finite State Machine (VMC FSM) - top level FSM, initiating and completing the VMC modes of operation.
Attachment:- Fundamentals of Digital Logic and Design Assignment File.rar