预览加载中,请您耐心等待几秒...
1/3
2/3
3/3

在线预览结束,喜欢就下载吧,查找使用更方便

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

libraryieee; useieee.std_logic_1164.all; useieee.std_logic_unsigned.all; entityauto_ticket_sellis port(money1,money2,money5,reset,clk,ticket,check:instd_logic; a0,a1,a2,a3,a4,a5:outstd_logic; m:outstd_logic_vector(6downto0)); endauto_ticket_sell; architecturebehaviorofauto_ticket_sellis signalq_money:integerrange0to100; signalout_put:integerrange0to10; signalq_ticket:integerrange0to100; signaltemp_a:integerrange0to5; begin process(money1,money2,money5,reset) begin if(reset='1')thenq_money<=0; elseif(money1'eventandmoney1='1')then q_money<=q_money+1; endif; endif; if(reset='1')thenq_money<=0; elseif(money2'eventandmoney2='1')then q_money<=q_money+2; endif; endif; if(reset='1')thenq_money<=0; elseif(money5'eventandmoney5='1')then q_money<=q_money+5; endif; endif; endprocess; p1:process(ticket,reset) begin if(reset='1')thenq_ticket<=0; elseif(ticket'eventandticket='1')then q_ticket<=q_ticket+1; endif; endif; endprocessp1; p2:process(clk,reset,temp_a)--实现6分频从而控制数码管 begin if(clk'eventandclk='1')then iftemp_a=5then temp_a<=0; else temp_a<=temp_a+1; endif; endif; casetemp_ais when0=>a0<='0'; whenothers=>a0<='1'; endcase; casetemp_ais when1=>a1<='0'; whenothers=>a1<='1'; endcase; casetemp_ais when2=>a2<='0'; whenothers=>a2<='1'; endcase; casetemp_ais when3=>a3<='0'; whenothers=>a3<='1'; endcase; casetemp_ais when4=>a4<='1'; whenothers=>a4<='1'; endcase; casetemp_ais when5=>a5<='0'; whenothers=>a5<='1'; endcase; endprocessp2; p3:process(clk,check) begin if(check'eventandcheck='1')then out_put<="1111111"; else casetemp_ais when0=>out_put<=q_money/10; when1=>out_put<=(q_money-(q_money/10)*10); when2=>out_put<=q_ticket/10; when3=>out_put<=(q_ticket-(q_ticket/10)*10); when4=>out_put<=(q_money-q_ticket*2)/10; when5=>out_put<=((q_money-q_ticket*2)-(q_money-q_ticket*2)/10*10); endif; endcase; endprocessp3; p4:process(money1,money2,money5,check) begin caseout_putis when0=>m<="1111110"; when1=>m<="0110000"; when2=>m<="1101101"; when3=>m<="1111001"; when4=>m<="0110011"