附录:自动售票系统设计源程序清单附录:自动售票系统设计源程序清单
顶层模块顶层模块modulepiaorstclk复位、时钟信号输入getca
celselcou
tci1ci5ci10ci50ci1001元、5元、10元、50元、100元输入co1co2co3co4出票cak1cak5cak10cak50找零cout找零显示i
putrstclki
putgetca
cel确认、取消买票信号高脉冲有i
putci1ci5ci10ci50ci100高脉冲有i
put10cou
tseloutputco1co2co3co4高脉冲有outputcak1cak5cak10cak50高脉冲有output70coutwire70mcou
t总钱数wirefi
ishwirefi
ishpwire70aassig
coutacou
tu1rstfi
ishci1ci5ci10ci50ci100mcou
tco
trlu2rstclkgetca
celselcou
tmcou
tafi
ishfi
ishpchupiaou3rstclkfi
ishpselcou
tco1co2co3co4zhaou4rstclkacak1cak5cak10cak50e
dmodule统计模块统计模块moduleto
gjirst复位高有clrci1ci5ci10ci50ci1001元、5元、10元、50元、100元cout统计出的总钱数i
putrsti
putclr清零信号i
putci1ci5ci10ci50ci100高脉冲有output70coutreg20q1q5q10q50q100assig
coutq15q510q1050q50100q1001元计数alwaysposedgerstorposedgeclrorposedgeci1begi
ifrst1q10
felseifclr1q10elsebegi
q1q11e
de
d5元计数alwaysposedgerstorposedgebegi
ifrst1q50elseifclr1q50elsebegi
q5q51e
de
d10元计数alwaysposedgerstorposedgebegi
ifrst1q100elseifclr1q100elsebegi
q10q101e
de
d50元计数alwaysposedgerstorposedgebegi
ifrst1q500elseifclr1q500elsebegi
q50q501e
de
d100元计数alwaysposedgerstorposedgebegi
ifrst1q1000elseifclr1q1000elsebegi
q100q1001
clrorposedgeci5
clrorposedgeci10
clrorposedgeci50
clrorposedgeci100
fe
de
de
dmodule
主控模块
modulezhuko
grstclk复位高有时钟getca
celsel票类别,cou
t票数mo
ey总钱数mout找零钱数fi
ish出钱信号fi
ishp出票信号i
putrsti
putclk时钟,i
putgetca
celi
put10selcou
ti
put70mo
eyoutputreg70moutoutputregfi
ishfi
ishp完成脉冲alwaysposedgerstorposedgeclkbegi
ifrst1begi
mout0fi
ish0fi
ishp0e
delsebegi
ifget1mo
eyselcou
tcou
tbegi
fi
ish1fi
ishp1moutmo
eyselcou
tcou
te
delseifca
cel1get1mo
eyselcou
tcou
tbegi
fi
ishp0fi
ish1moutmo
eye
delse
fbegi
fi
ishp0fi
ish0e
de
de
de
dmodule
出票模块
modulechupiaorstclk复位高有e
使能sel票类别cou
t票数co1co2co3co4各种票输出i
putrstclr