出租车计价器-课程设计报告(共14页).doc





《出租车计价器-课程设计报告(共14页).doc》由会员分享,可在线阅读,更多相关《出租车计价器-课程设计报告(共14页).doc(14页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上软件学院课程设计报告课 程 题 目 出租车计价器班 级 集成13-4专 业 集成电路设计与集成系统学生学号 指导教师 (填写自己班的指导教师) 年 月 日1. 课程设计目的全面熟悉、掌握VHDL语言基本知识,掌握利用VHDL语言对常用的组合逻辑电路和时序逻辑电路编程,把编程和实际结合起来,熟悉编制和调试程序的技巧,掌握分析结果的若干有效方法,进一步提高上机动手能力,培养使用设计综合电路的能力,养成提供文档资料的习惯和规范编程的思想。2.课程设计题目描述和要求2.1.课程设计题目描述.实现计费功能,计费标准为:按行驶里程计费,起步价为7.0元,并在车行3km后按2.2元
2、/km计费,当计费器达到或超过20元时,每公里加收50%的车费,车停止不计费。.现场模拟功能:以开关或按键模拟公里计数,能模拟汽车起动、停止、暂停等状态。.将车费和路程显示出来,各有一位小数。2.2.总体设计思路框架出租车计费器顶层模块分频模块里程计算模块价格计算模块译码模块2.3.课程设计题目要求.设计正确,方案合理。.程序精炼,结构清晰。.设计报告含程序设计说明,用户使用说明,源程序清单及程序框图。.上机演示。.有详细的文档。文档中包括设计思路、设计仿真程序、仿真结果及相应的分析与结论。 3.设计思想和设计内容 3.1 出租车计费设计该出租车计费器按下开关S1后开始计费和计里程数,起步价是
3、7元,行驶3公里,以后2.2元/公里。并且设计选择模块,在车费超过20元每公里加收50%车费即3.3元/公里。3.2 基本设计思想出租车计费器根据设计要求可初步分为3方面显示、记里程数、记费。之后再根据三方面分别设计模块。1.显示模块。一般计数器显示数字为1-F即16进制,而16进制不方便观看,所以在设计这一模块时我们将16进制改为10进制输出进而设计了译码模块。2、里程模块。设计要求对里程计数主要分为两个方面,计数以及公里数比较。即3公里之内收7元,3公里之后20元(通过计算为9公里)以内每公里2.2元,9公里以外为每公里3.3元。所以,我们将里程模块分为里程计数模块以为比较模块。3.计费模
4、块。计费模块同里程比较模块所以将两个模块合二为一,为价格计算模块。4. Verilog代码 4.1顶层模块module taxi(clk,stop,rst_n,time1,time2,time3,time4,seg1,seg2,seg3,seg4);input clk;input stop;input rst_n;output 6:0time1;output 6:0time2;output 6:0time3;output 6:0time4;output 6:0seg1;output 6:0seg2;output 6:0seg3;output 6:0seg4;wire clk_fp;wire 1
5、5:0distance;wire 15:0price;wire 15:0distan_bcd;wire 15:0price_bcd;fp my_fp(clk,clk_fp,rst_n,stop);distance_counter dis_counter(clk_fp,rst_n,stop,distance);price_counter price_coun(clk_fp,rst_n,stop,price,distance);yimaqi distance_BCD(distance,distan_bcd,clk_fp);yimaqi price_BCD(price,price_bcd,clk_f
6、p);dispaly_my aa(clk_fp,distan_bcd,seg1,seg2,seg3,seg4);dispaly_my bb(clk_fp,price_bcd,time1,time2,time3,time4);endmodule4.2分频模块module fp(clk,clk_fp,rst_n,stop);/50mhzinput clk;input rst_n;input stop;output clk_fp;reg 25:0 counter;reg clk_fp;always(posedge clk or negedge rst_n or negedge stop)begin
7、if(!rst_n)beginclk_fp=1d0;counter=26d0;endelse if(!stop)begincounter=counter;endelsebeginif(counter=26d49_999_999)beginclk_fp=1b1;counter=1b0;endelsebeginclk_fp=1b0;counter=counter+1b1;endendendendmodule4.3里程计算模块clk_fp,rst_n,stop,distance);input clk_fp;/1Sinput rst_n;input stop;output 15:0distance;r
8、eg 15:0distance;always(posedge clk_fp or negedge rst_n)beginif(!rst_n)distance=8d0;else if(!stop)distance=distance;elsedistance=distance+5d10;endendmodule4.4价格计算模块module price_counter(clk_fp,rst_n,stop,price,distance);input clk_fp;/1Sinput rst_n;input stop;input 15:0distance;output 15:0price;reg 15:
9、0price;always(posedge clk_fp or negedge rst_n or negedge stop)beginif(!rst_n)price=8d0;else if(!stop)price=price;elseif(distance=30)price=16d70;else if(distance=90&30distance)price=price+16d22;else price=price+16d33;endendmodule4.5译码模块module yimaqi(num_hex,BCD,clk_fp);input 15:0num_hex;input clk_fp;
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 出租车 计价器 课程设计 报告 14

限制150内