【正文】
=lch[7:4]+439。 lch[3:0]=439。 end end else if(count==639。b000000。b000001。 input reset,start,clk_1。 reg [5:0] count1,count2。 always(negedge reset,posedge clk_1) begin if(!reset) begin count2=639。 count1=639。 jishi=839。 jishi_1=839。 end else begin if(!start) begin if(count1==639。b00000001。b000001。b000001。b000011) begin jishi_1=jishi_1+139。 count2=639。 end if(jishi[3:0]439。b0001。b0000。b000010) count1=639。 else count1=count1+639。 end end end:。當(dāng)出租車停車時,時鐘select_clk用于將費用計數(shù)器復(fù)位為起步價8元;當(dāng)車處于行駛狀態(tài)且滿3公里時,此后路程每滿1公里,費用計數(shù)器加1元;當(dāng)出租車處于停止等待狀態(tài)且時鐘滿3分鐘時,時間每滿3分鐘,費用計數(shù)器加1元。 input lch,jishi_1。 reg [13:0] fee。 wire [7:0] jishi_1。b00000010) begin if(jishi_1[7:0]839。b0,lch[3:0]}+539。b00010。b0,lch[7:4]}。b0000。b01001) begin fee[4:0]=fee[4:0]539。 fee[9:5]=fee[9:5]+539。 end end else begin fee[4:0]={139。b0,lch[3:0]}539。b01000539。 fee[9:5]={139。b0,lch[7:4]}。b0000。b10011) begin fee[4:0]=fee[4:0]539。 fee[9:5]=fee[9:5]+539。 end else if(fee[4:0]539。b01010。b00001。b10011) begin fee[9:5]=fee[9:5]539。 fee[13:10]=fee[13:10]+439。 end else if(fee[9:5]539。b01010。b0001。b00000010) begin fee[13:0]=1439。 end else begin fee[4:0]={139。b00001+539。 fee[9:5]={139。b0,lch[7:4]}。b0000。b10011) begin fee[4:0]=fee[4:0]539。 fee[9:5]=fee[9:5]+539。 end else if(fee[4:0]539。b01010。b00001。b10011) begin fee[9:5]=fee[9:5]539。 fee[13:10]=fee[13:10]+439。 end else if(fee[9:5]539。b01010。b0001。 input clk_1,lch,jishi,fee,reset。 wire reset。 wire [7:0] jishi。 reg [6:0] hex0,hex1,hex2,hex4,hex5,hex6,hex7。b1000000。b1000000。b1000000。b1000000。b1000000。b1000000。b1000000。b0000:hex6[6:0]=739。 439。b1111001。b0010:hex6[6:0]=739。 439。b0110000。b0100:hex6[6:0]=739。 439。b0010010。b0110:hex6[6:0]=739。 439。b1111000。b1000:hex6[6:0]=739。 439。b0010000。b1000000。b0000:hex7[6:0]=739。 439。b1111001。b0010:hex7[6:0]=739。 439。b0110000。b0100:hex7[6:0]=739。 439。b0010010。b0110:hex7[6:0]=739。 439。b1111000。b1000:hex7[6:0]=739。 439。b0010000。b1000000。b0000:hex4[6:0]=739。 439。b1111001。b0010:hex4[6:0]=739。 43