Question: # Verilog Vending Machine State Detailed Specification ## Timing Requirements 1 . All state transitions must occur on posedge clock 2 . Coin processing must
# Verilog Vending Machine State Detailed Specification
## Timing Requirements
All state transitions must occur on posedge clock
Coin processing must occur on negedge clock and trigger only once
Reset functionality is asynchronous and must be processed immediately
Statements must be implemented using Case statements
vendingmachine inputs include clkbits drinkchoose, bits money, cancel; output has bits change
Implement the vending machine simulation using the finite state machine method shown in the diagram
## S: Initial State Coin Input State
Functional Requirements:
Display current total amount inserted
Accept coins NTD
Only one coin can be inserted at a time
Must update and display total amount in realtime
Transition to S state when input amount reaches minimum beverage price NTD
Return all inserted money when cancel button reset is pressed
Process coin insertion on negedge clock
## S: Selection State Available Beverage Display State
Functional Requirements:
Display available beverages based on inserted amount:
NTD: Display Tea
NTD: Display Tea, Coke
NTD: Display Tea, Coke, Coffee
NTD: Display Tea, Coke, Coffee, Milk
Allow continued coin insertion to increase amount
Wait for customer beverage selection drinkchoose input
Upon beverage selection, check if amount is sufficient:
Sufficient: Transition to S state
Insufficient: Remain in current state
If cancel button is pressed, transition to S state and return all money
## S: Dispensing State Output State
Functional Requirements:
Output selected beverage name
Calculate change amount
Automatically transition to S state upon completion
Do not accept new coins or selections in this state
If cancel button is pressed, transition to S state and return all money
## S: Checkout State Change Return State
Functional Requirements:
Calculate and display change amount inserted amount beverage price
Output change amount bit change output
Automatically transition back to S state upon completion
Do not accept new coins or selections in this state
If cancel button is pressed, transition to S state and return all money
## Reset Functionality Applicable to All States
Functional Requirements:
When reset cancel button is pressed in any state:
Immediately stop current operation
Return all inserted money
Clear all state records
Return to S initial state
Ensure all counters and registers are cleared during reset
Display returned amount
## Deliverable
One main.v file
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
