【正文】
end Behavioral。 end if。 end if。 isneedDone1:=39。 when others=outMoney=00000011。 when 8=outMoney=00000001。 when 6=outMoney=01000001。 when 4=outMoney=10011001。 when 2=outMoney=00100101。 else case j1 is when 0=outMoney=00000011。 isneedDone1:=39。 if(needMoney1=10 and j1=9) then needMoney1:=needMoney110。 j1:=0。139。 end if。 22 isneedDone0:=39。 when others=outMoney=00000011。 when 8=outMoney=00000001。 when 6=outMoney=01000001。 when 4=outMoney=10011001。 when 2=outMoney=00100101。 else case needMoney0 is when 0=outMoney=00000011。 isneedDone0:=39。 end if。139。 end if。 istotDone1:=39。 when others=outMoney=00000011。 when 8=outMoney=00000001。 when 6=outMoney=01000001。 when 4=outMoney=10011001。 when 2=outMoney=00100101。 else case j0 is when 0=outMoney=00000011。 istotDone1:=39。 if(totMoney1=10 and j0=9) then totMoney1:=totMoney110。 j0:=0。139。 end if。 istotDone0:=39。 when others=outMoney=00000011。 when 8=outMoney=00000001。 when 6=outMoney=01000001。 when 4=outMoney=10011001。 when 2=outMoney=00100101。 else case totMoney0 is when 0=outMoney=00000011。 istotDone0:=39。 end if。139。139。 begin if(clk39。 variable needMoney1:integer range 0 to 99。 variable j1:integer range 0 to 9。 variable j0:integer range 0 to 9。 20 end process。 end case。choOut3=39。choOut2=39。choOut1=39。 when 3 = choOut0=39。choOut3=39。choOut2=39。choOut1=39。 when 2 = choOut0=39。choOut3=39。choOut2=39。choOut1=39。 when 1 = choOut0=39。choOut3=39。choOut2=39。choOut1=39。 case choClk is when 0 = choOut0=39。 else choClk=3。 elsif(j=100000 and j202000) then choClk=1。 end if。 if(j=400000 and j=0) then j:=j+1。139。039。 i:=i+1。) then if(i=4000000 or i0) then i:=0。event and clk=39。 variable j: integer range 0 to 400000。 end process main。 end case。 end if。 ableOk:=39。) then state=sstart。 19 if(ok/=lastOk and ableOk=39。 co10=tempCo10。 else co1=tempCo1。 tempCo1:=tempCo1+1。 tempCo5:=tempCo5+1。 tempCo10:=tempCo10+1。 tempCo20:=tempCo20+1。139。 end if。 state=srefund。 lout4=39。 lout3=39。 else if(totMoney=needMoney) then totMoney:=totMoneyneedMoney。139。039。 if (lastcancel/=cancel)then lastcancel:=cancel。end if。unablec20:=39。039。139。end if。unablec10:=39。039。139。 end if。unablec5:=39。039。139。 end if。unablec1:=39。039。139。 end if。 isAdd:=39。) then needMoney:=choGoods1*choNum1+choGoods2*choNum2。 if(isAdd=39。039。139。039。end if。) then unablec10:=39。 and unablec10=39。 if(c10=39。039。139。039。 end if。) then unablec1:=39。 and unablec1=39。 if(c1=39。 unablebut4:=39。 unablebut3:=39。 unablebut2:=39。 unablebut1:=39。 付款 when spayment = unablebut0:=39。) then state=sstart。 if(rst=39。 state=schoGoods20。 lout1=39。 lout2=39。 end if。039。139。039。) then lastOk:=ok。 if(ok/=lastOk and ableOk=39。139。139。) then choNum2:=3。 and unablebut3=39。 elsif(but3=39。ableOk:=39。unablebut2:=39。039。139。139。139。) then choNum2:=1。 and unablebut1=39。 elsif(but1=39。ableOk:=39。unablebut0:=39。039。139。 end if。) then unablebut3:=39。 and unablebut3=39。 if(but3=39。039。139。039。 end if。) then unablebut1:=39。 and unablebut1=39。 if(but1=39。039。139。039。 end if。139。039。 if (lastcancel/=cancel)then 17 lastcancel:=cancel。 state=schoNum2。 ableOk:=39。 lout2=39。 lout1=39。139。 end if。139。 sneedMoney=needMoney。 end if。139。139。) then choGoods2:=16。 and unablebut1=39。 elsif(but1=39。 ableOk:=39。unablebut0:=39。039。139。139。 end if。 ableOk:=39。unablebut4:=39。039。139。139。139。) then choGoods2:=13。 and unablebut3=39。 elsif(but3=39。 ableOk:=39。unablebut2:=39。039。139。139。139。) then choGoods2:=11。 and unablebut1=39。 elsif(but1=39。 ableOk:=39。unablebut0:=39。039。139。039。 end if。ableOk:=39。 unablebut4:=39。039。139。139。139。 and choGoods1=0) then choGoods2:=8。 and unablebut3=39。 elsif(but3=39。ableOk:=39。 unablebut2:=39。039。139。139。139。) then choGoods2:=6。 and unablebut1=39。 elsif(but1=39。ableOk:=39。 unablebut0:=39。039。139。139。 end if。 16 ableOk:=39。unablebut4:=39。039。139。139。139。) then choGoods2:=3。 and unablebut3=39。 elsif(but3=39。 ableOk:=39。unablebut2:=39。039。139。139。139。) then choGoods2:=1。 and unablebut1=39