freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

出租車計價器設(shè)計方案和功能介紹verilog、fpga(編輯修改稿)

2024-09-15 20:33 本頁面
 

【文章內(nèi)容簡介】 。amp。run==1) begin if(count1=4) begin count1=0。count=count+1。 end //為了方便模擬, else count1=count1+1。 end distance=count。 endendmodule3 時鐘模塊//時鐘模塊//為系統(tǒng)提供時間module clock(clk, //1Hz時鐘 hour_out, //時,顯示時間 min_out, //分,顯示時間 sec_out, //秒, 顯示時間 )。input clk。output [7:0] hour_out,min_out,sec_out。reg [7:0] hour_out,min_out,sec_out。initialbegin hour_out=12。 min_out=0。 sec_out=0。endalways @(posedge clk)begin if(sec_out59) begin sec_out=sec_out+739。b1。 end if(sec_out==59) begin sec_out=0。 if(min_out59) min_out=min_out+739。b1。 end if(min_out==59) begin min_out=0。 if(hour_out23) hour_out=hour_out+739。b1。 end if(hour_out==23) begin hour_out=0。 end endendmodule4 等待時間計數(shù)模塊//等待時間模塊module wait_time (clk, //1Hz start, //計費啟動開關(guān) run, //出租車運行狀態(tài)開關(guān) led_stop, wait_time //等待時間 )。 input clk,run。 input [3:0] start。 output [15:0] wait_time。 output led_stop。 reg [15:0] wait_time,count。 reg led_stop。 always@(posedge clk) begin if(start==0) wait_time=0。 //清零 if(start==1amp。amp。run==0) //計價開關(guān)為1,且車狀態(tài)位0,開始計時 begin led_stop=1。 if(count10) count=count+1639。b1。//為了便于模擬,每10s,當做一分鐘 else begin count=0。wait_time=wait_time+1。end end else begin led_stop=0。 end endendmodule5 計價模塊// 計價模塊//根據(jù)里程、時鐘、等待時間計算出總價//里程:判斷遠程和近程//時鐘:判斷白天和晚上//價格單位:元//里程單位:千米//等待時間單位:分鐘//時間和里程為整數(shù)//價格為小數(shù)module charge(clk, //50MHz start, //計費啟動開關(guān) run, //出租車運行狀態(tài)開關(guān) distance, //里程 hour, //時鐘,時 min, //時鐘,分 sec, //時鐘,秒 wait_time, //等待時間 day_time, //白天開始時間 night_time, //晚上開始時間 short_distance, //起步價可行最大里程數(shù) long_distance, //最大近程里程數(shù) price_day_short, //白天近程單價 price_day_long, //白天遠程單價 price_night_short, //晚上近程單價 price_night_long, //晚上遠程單價 one_price_day, //白天起步價 one_price_night, //晚上起步價 price_wait_time, //等待時間每分鐘價格 charge, //總費用 total_charge, total_distance )。 input clk,run。 input [3:0] start。 input [7:0] hour,min,sec,day_time,night_time。 input [7:0] short_distance,long_distance。 input [7:0] price_day_short,price_day_long,price_night_short,price_night_long,price_wait_time。 input [11:0] one_price_day,one_price_night。 input [15:0] distance,wait_time。 output [15:0] charge。 output [15:0] total_charge,total_distance。 reg [15:0] one_price,charge。 reg [15:0] distance1,distance2。 reg [15:0] total_charge,total_distance。 reg [15:0] t1。 //白天近程里程數(shù) reg [15:0] t2。 //白天遠程里程數(shù) reg [15:0] t3。 //晚上近程里程數(shù) reg [15:0] t4。 //晚上遠程里程數(shù) reg flag,flag1。 always@(posedge clk) begin if(start==0) //清零 begin flag=0。 flag1=1。 t1=0。 t2=0。 t3=0。 t4=0。 one_price=0。 end if(start==1amp。amp。flag==0) begin flag=1。 if(hour=day_timeamp。amp。hour=night_time) one_price=one_price_day。 //白天,起步價 else one_price=one_price_night。 //夜晚,起步價 end distance1=distance。 //檢測該時鐘與該時鐘之前時鐘的變量值,是否相等。有變化則執(zhí)行下面語句。 distance2=distance1。 if(distanc
點擊復制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1