`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 14:30:19 07/11/2008 // Design Name: // Module Name: input_controller // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module input_controller(ni, qi, di, reset, clk, fsm_ni, fsm_qi, fsm_di); input ni; input qi; input di; input clk; input reset; output fsm_ni; output fsm_qi; output fsm_di; /* You need to design a state machine here. ni, qi and di are inputs from pushbuttons on the board corresponding to a nickel, quarter or dime inserted into the machine. The state machine should produce a pulse on the output lines, corresponding to the coin inserted e.g) fsm_ni should be high when the push button corresponding to ni is pressed. Note that fsm_ni in the example should be high precisely for 1 clock cycle irrespective of how long the push button is pressed. Basically, the outputs should be pulses with width 1 clock cycle each time the corresponding push button is pressed. This is to ensure that you don't get the candy when you press the ni button down once and hold it there. You will have to press the ni button down 5 times to get the candy. */ /* You may find a behavioral description of the state machine with case statements easier than a structural description */ endmodule