Homework6a_Vending_Machine

pdf

School

University of California, San Diego *

*We aren’t endorsed by this school

Course

111

Subject

Industrial Engineering

Date

Oct 30, 2023

Type

pdf

Pages

9

Report

Uploaded by Cozmowo

Homework-6a : Vending Machine ECE-111 Advanced Digital Design Project Vishal Karna
Homework-6a : Vending Machine Design FSM for Vending Machine with following mentioned requirements: Dispatches a pack of candy upon deposit of 15 cents by the customer Has single coin slot and only accepts nickels and dimes. Doesn’t take pennies or quarters Does not provide any change back to the customer in case more than 15 cents are deposited Once candy is dispatched, vending machine should move to reset state 2 Vending Machine FSM N open clk rstn Coin Sensor D Candy Release Mechanism Vending Machine Moore State Transition Diagram CENTS_0 OPEN = 0 CENTS_5 OPEN= 0 CENTS_10 OPEN = 0 (N=0 & D=0) || rstn=0 N=1 D=1 D=1 CENTS_15 OPEN = 1 N=1 N=1 or D=1 rstn=1 rstn=0 N=0 & D=0 N=0 & D=0 This Vending machine requires manual reset to go back to CENTS_0 state after candy is dispatched. Hence rstn=0 is required for FSM to transition from CENTS_15 to CENTS_0
Homework-6a : Vending Machine Vending Machine FSM supports Manual Reset, however FSM with Auto Reset can also be implemented Manual Reset FSM : Requires reset to be asserted (rstn = 0) for FSM to go back to CENTS_0 state from CENTS_15 state once candy is dispatched Auto Reset FSM : Without reset (rstn = 0), FSM transitions from CENTS_15 to CENTS_0 3 With Manual Reset N=0 & D=0 N=0 & D=0 Students can implement FSM with Manual reset or Auto Reset. Auto Reset means that After entering CENTS_15 state, FSM will transition unconditionally without any reset, to CENTA_0 state With Auto Reset (Alternate Implementation) CENTS_0 OPEN = 0 CENTS_5 OPEN= 0 CENTS_10 OPEN = 0 (N=0 & D=0) || rstn=0 N=1 D=1 D=1 CENTS_15 OPEN = 1 N=1 N=1 or D=1 N=0 & D=0 N=0 & D=0 This Vending machine requires manual reset to go back to CENTS_0 state after candy is dispatched. Hence rstn=0 is required for FSM to transition from CENTS_15 to CENTS_0 CENTS_0 OPEN = 0 CENTS_5 OPEN= 0 CENTS_10 OPEN = 0 (N=0 & D=0) || rstn=0 N=1 D=1 D=1 CENTS_15 OPEN = 1 N=1 N=1 or D=1 rstn=1 rstn=0
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Homework-6a : Vending Machine In mealy FSM register input's N and D if output "open" gets asserted to '1' before depositing 15 Cents (register means add flipflop) When implementing mealy FSM for Vending Machine, add a flipflop at the input of 'N' and 'D' And these registered 'r_N' and 'r_D' should be used in always_comb next state logic procedural blocks 4 Without Registering N and D, See Potential Waveform Snapshot Below with pre-mature open = 1
Homework-6a : Vending Machine Mealy FSM Waveform snapshot with after adding flipflop at the inputs 'N' and 'D' 'r_N' and 'r_D' signals in waveform snapshot are output of flipflops for inputs 'N' and 'D' In Moore FSM for Vending Machine, inputs N and D does not require flipflop, as output "open" is '1' only when FSM reaches CENTS_15 state (i.e. only after 15 cents or more are deposited) In Mealy FSM for Vending Machine, as the output "open" can be '1' in when transiting from CENTS_5 to CENTS_15 or from CENTS_10 to CENTS_15, and since inputs N and D can be changed to '1' in middle of clock cycle, adding flipflop at the inputs N and M can prevent open be go '1' pre-maturely from FSM 5 "open" is correctly asserted to '1' only after Nickel (N=1) and Dime (D=1) are inserted in Vending Machine. Mealy FSM Waveform with flipflops added for Inputs 'N' and 'M' SystemVerilog Code demonstrating how to add flipflop at the inputs 'N' and 'D'
Homework-6a : Vending Machine Mealy FSM for Vending Machine Can have 1 less state opportunity of state reduction Output open = 1 is already being set when transitioning from CENTS_5 and CENTS_10 states to CENTS_15 state and in CENTS_15 state FSM machine just waits for reset condition to transition back to CENTS_0 state Hence CENTS_15 state is redundant and not necessary to have in case of Mealy Machine Note : Either of the Mealy FSM design for Vending Machine (i.e. with or without CENTS_15 state) will be accepted as homework submission 6 Is this CENTS_15 state for Mealy State Machine Required ? Answer : No Move rstn==0 logic from CENTS_15 to CENTS_10 state and if N=1 or D=1 in CENTS_10 state then continue to have FSM state in CENTS_10 state. And if rstn==0 in CENTS_10 state then move to CENTS_0 state
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Homework-6a : Vending Machine For Vending Machine develop SystemVerilog code for More and Mealy FSM Use binary encoding for state variables Review Vending state transition table and Moore FSM state transition diagram for FSM code development Design state transition diagram for mealy implementation Synthesize and review RTL netlist schematic, state machine viewer and resource usage Simulate both Moore and Mealy implementation using testbench provided and Review waveforms Design top SystemVerilog module name should be vending_machine_moore and vending_machine_mealy 7 Next State and Output Function next[0] = state[0].D’.N’ next[1] = state[0].N + state[1].D’.N’ next[2] = state[0].D + state[1].N + state[2].D’.N’ next[3] = state[1].D + state[2].D + state[2].N + state[3] open = Q3 Vending Machine State Transition Table (For Moore and Mealy)
Homework-6a : Vending Machine Assume below mentioned primary Ports for Vending Machine Input clk : posedge clock Input rstn : reset should be synchronous negedge reset Input N, D : 1-bit Nickel and Dime inputs indicating Nickel and Dime are deposited if values are '1' Output open : 1-bit open signal indicating vending machine is dispatching candy 8 Vending Machine clk rstn N open D Output “open” is asserted once 15 cents or more are deposited Reference Moore FSM Simulation Waveform
Homework-6a : Vending Machine 9 Report should include : SystemVerilog design code for both Moore and Mealy FSM Synthesis resource usage and schematic generated from RTL netlist viewer Simulation snapshot and explain simulation result for both Moore and Mealy FSM FSM state transition diagram for both Moore and Mealy implementations Explanation of FPGA resource usage in report is not required. Note : State transition diagram needs to be submitted in report and it can be either hand drawn with picture taken and pasted in report or it could be drawn in word or powerpoint or auto-generated sate machine diagram from Quartus prime is also acceptable. If submitting auto-generated Quartus generated state machine diagram then also attach state transition table generated from Quartus prime. For Moore FSM diagram from this requirements document can also be used Simulation transcript is not required in report since there are no prints from testbench Lab6 folder includes : Template design code for Vending machine Moore and Mealy FSM are provided Full testbench code for both Moore and Mealy FSM are provided For learning purpose, student can change the stimulus in initial block in testbench file.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help

Browse Popular Homework Q&A

Q: Provide the correct IUPAC name for the compound shown here. HS
Q: What is their net profit when 40 tickets are sold?
Q: FCOJ, Inc., a prominent consumer products firm, is debating whether or not to convert its all-equity…
Q: In 2007, the percentage of children under 18 years of age who lived with both parents was 67.3, the…
Q: To what extent could employees' happiness at work determine whether or not a company succeeds or…
Q: Solve the following system of equations using the Gauss-Jordan method. - 10x-6y-z = -32 - 6x 10y-2z=…
Q: Which of the following series should be used to determine the divergence of the series √3n² + 2n + 3…
Q: Calculate the formula or molar mass, to the hundredths place, of the following compounds.Write the…
Q: 6) How many 60 Watt bulbs would it take to equal the luminosity of the Sun? a. 1000 b. 2.4 X 10^26…
Q: A planet moves in an elliptical orbit around a star. This is a two-body system. Which of the…
Q: The birthday paradox in probability theory asks what is the probability that in a set of n randomly…
Q: A submarine rests on the ocean floor at a depth of 800 m. Calculate A) the pressure at this depth…
Q: 2. Find the general solution to the 1st order linear ODE: y' + 2xy = x³.
Q: Divide 3987654321 by 11. What is the remainder?
Q: Using your own words, describe how to pass a variable, string or otherwise, to a procedure and also…
Q: A pan of enchiladas is served at a dinner party. It starts to cool according to Newton's Law of…
Q: 5) Consider the RLC tank circuit shown in Figure 4 being driven by an AC current source. Current…
Q: Watch help video Name the marked angle in 2 different ways. T R
Q: Similar to acetic acid, benzoic acid is a weak acid (HA) and is a commonly used as antimicrobial…
Q: (A) Find a formula for the inverse of the function ƒ-¹(x) = . f(x) = √√√x² + 4x, x > 0.
Q: Identify the variables - Students who spend more time playing video games and working each week will…
Q: Why do you think race is such an uncomfortable topic in the United States? IN YOUR OWN WORDS