Question 4 State Machines (25 marks) A state machine is required for a simple vending machine. The m

Question 4 State Machines (25 marks) A state machine is required for a simple vending machine. The machine takes one dollar coins only. Each time a coin is added the input signal “coin” is set to 1 for one clock cycle When a total of $4 has been added the output signal “deliver” is set to 1 for one clock cycle and the state machine starts counting coins for the next delivery a) (5 marks) Draw a state diagram for this state machine. Make sure you label each state with a state name and the value of the “deliver” output. Also make sure you label each transition with the value of the “coin” input. Please use “VMO”, “VM1” “VM2”.. for the state names. b) For an ASIC implementation of the vending machine, a binary state encoding is the best choice i) (3 marks) Perform a binary state assignment. Please use “s0”, “s1”, … for the binary state bit names. (4 marks) Using this state assignment, draw a state table showing next state as a function of current state and the “coin” input. Use “next_s0”, “next_s1”, … for the binary next state bit names. Using the state table, derive (unoptimised) equations for the next state bits. ii) (3 marks) Using this state assignment, draw an output table showing the outputs as a function of current state and the “coin” input. Using the output table, derive an (unoptimised) equation for the “deliver” output c) For an FPGA implementation of the vending machine, a one-hot (or modified one- hot) state encoding is the best choice. i) (3 marks) Perform a one-hot (or modified one-hot) state assignment. Please use “vm0”, “vm1”, … for the state signal names. i) (4 marks) Using this state assignment, draw a state table showing next state as a function of current state and the “coin” input. Use “next_vm0”, “next_vm1”, .. for the next state signal names. Using the state table, derive (unoptimised) equations for the next state signals.

 

Looking for a Similar Assignment? Let us take care of your classwork while you enjoy your free time! All papers are written from scratch and are 100% Original. Try us today! Use Code FREE15