when others=>
null;
end case; case coin is
--硬币识别
when "01"=>
total_insert:=total_insert+"00000101";
--5角硬币
when "10"=>
total_insert:=total_insert+"00001010";
--1元硬币
when others=>
null;
end case;
if(cancel='1') then
--按下“取消”按钮 --回到初始状态
state<=initialize_state;
end if; if(temp='1')
then
--判断投入钱币金额达到总票价
money_gate<="10";
--钱币“暂存杆”将钱币推入售票机内,表示接受投币
state<=ticket_state; --系统进入出票状态
end if;
if(total_insert>=total_price) then
--判断投入总金额是否已达到票价总额
temp:='1'; --记录投入钱币金额达到总票价
end if;
--出票状态 --计算应找零金额
when ticket_state=>
if(number="11") then
change:=total_insert-price-price-price; elsif(number="10") then
change:=total_insert-price-price; elsif(number="01") then
change:=total_insert-price; end if;