Vhdl Code for Vending Machine

March 19, 2019 | Author: Sanjay Singh Chouhan | Category: N/A
Share Embed Donate


Short Description

Download Vhdl Code for Vending Machine...

Description

--using textio.all Entity Soda_Machine is port( --would need maximum of 30 nickles NICKEL_IN : std_logic_vector(4 downto 0); --would need maximum of 15 dimes DIME_IN : std_logic_vector(3 downto 0); --would need maxium of 6 quarters QUARTER_IN: std_logic_vector(2 downto 0); SELECTION: std_logic_vector(15 downto 0); PRICE: out std_logic_vector(15 downto 0); RESET: BOOLEAN; CLK: BIT; --return change and soda NICKEL_OUT, DIME_OUT, DISPENSE: out BOOLEAN ); End Soda_Machine; architecture BEHAVIOR of Soda_Machine is signal Current_Coin_Count, Next_Coin_Count: INTEGER range 0 to 30; -- 30 nickles is $1.50 signal Current_Return_Change, Next_Return_Change : BOOLEAN; begin process(NICKEL_IN, DIME_IN, QUARTER_IN, RESET, CLK, Current_Coin_Count, Current_Return_Change) --maximum amount of coins --possible is 30 niickles variable Temp_Coin_Count: INTEGER range 0 to 30; begin -- Set all Change Returned to 0 NICKEL_OUT
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF