![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
[多选题]
下面是一个用状态机设计的自动售货机,one_dollar代表投币一元,half_doller代表投币五角。则下列说法正确的是()。modulemachine(one_dollar,half_dollar,collect,half_out,dispense,reset,clk);parameteridle=2'b00,half=2'b01,one=2'b10;inputone_dollar,half_dollar,reset,clk;outputcollect,half_out,dispense;regcollect,half_out,dispense;reg[1:0]D;always@(posedgeclk)beginif(reset)begindispense=0;collect=0;half_out=0;D=idle;endelsecase(D)idle:if(half_dollar)begindispense=0;collect=0;half_out=0;D=half;endelseif(one_dollar)begindispense=0;collect=0;half_out=0;D=one;endelsebegindispense=0;collect=0;half_out=0;D=idle;endhalf:if(half_dollar)begindispense=0;collect=0;half_out=0;D=one;endelseif(one_dollar)begindispense=1;collect=1;half_out=0;D=idle;endelsebegindispense=0;collect=0;half_out=0;D=half;endone:if(half_dollar)begindispense=1;collect=1;half_out=0;D=idle;endelseif(one_dollar)begindispense=1;collect=1;half_out=1;D=idle;endelsebegindispense=0;collect=0;half_out=0;D=one;enddefault:begindispense=0;collect=0;half_out=0;D=idle;endendcaseendendmodule
A.饮料的售价为一元五角
B.该状态机是mealy型状态机
C.该状态机的输出只与当前状态有关
D.当投入两元钱后,找零五角,同时状态机跳转至idle状态
查看答案
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)