出租车计费器的设计

上传人:汽*** 文档编号:470444840 上传时间:2023-06-23 格式:DOCX 页数:22 大小:342.61KB
返回 下载 相关 举报
出租车计费器的设计_第1页
第1页 / 共22页
出租车计费器的设计_第2页
第2页 / 共22页
出租车计费器的设计_第3页
第3页 / 共22页
出租车计费器的设计_第4页
第4页 / 共22页
出租车计费器的设计_第5页
第5页 / 共22页
点击查看更多>>
资源描述

《出租车计费器的设计》由会员分享,可在线阅读,更多相关《出租车计费器的设计(22页珍藏版)》请在金锄头文库上搜索。

1、JIANGSU TEACHERS UNIVERSITY OF TECHNOLOGY通信电子线路课程设计调频器的设计学院名称:电气信息工程学院专业:通信工程班级:08通信1w姓名:储旭学 号:08333217指导教师姓名:钱志文谈发明2011目录实验要求1.1 技术要求1.2 功能要求二本人任务 2三实验原理 23.1设计思路框图 33.1设计思路33.3设计框图4四单元模块设计 54.1 分频模块 54.2 .2计费模块64.3 转码模块94.4 位选模块114.5 八选一模块124.6 3-8译码模块134.7 数码管译码模块14五顶层模块设计 151.1 程序151.2 顶层文件仿真图17

2、1.3 软件框图18六 硬件电路设计及安装 18七 硬件电路安装与调试 18八调试结果与分析说明19九收获与体会 19十参考文献 20实验要求1.1 技术要求用VHDLiS言设计符合要求的计费器,并用层次化设计该电路。各计数器的技术状态用功能的方法验证,并通过有关波形确认电路设计是否正确 完成电路全部设计后,通过系统试验箱下载验证设计课题的正确性。1.2 功能要求设计一个出租车计费器,具有模拟汽车启动,停止,暂停,车速等状态,实现预置起步价,每公里收费和车行加费里程功能,计价分辨率为 0.01元,用四位数码管显示 总金额和里程。按行驶里程收费,起步价为7.00元,并在车行3公里后再按2.2元/

3、公里,当计费器 达到或超过一定收费(如20元)时,每公里加收50%勺车费,车停止不计费。二本人任务我主要负责软件部分的设计。主要包括分频、计费、计数转换、数码管译码、位选、8选1、3-8译码器七个模块的程序设计三实验原理3.1 设计思路框图开始置数数明管译书与暂停一停止)降的,动态扫描3.2 设计思路按键功能模块Start键、js键高电平有效,stop键、pause键低电平有效。Start=0时,预置数,计费部分为07.00,路程计数部分为00.00。Start=1=1 , pause=1, js=0表示每来一个脉冲汽车前进 2米;Start=1 , pause=1, js=1表示每来一个脉冲

4、,汽车前进 10米;Pause =0表示汽车暂停,也就是计费部分和路程部分的值保持不变;Stop=0表示计费和路程部分清零;(2)计数模块当汽车处于加速状态时,每来一个脉冲,路程模块加10ml当汽车正常行驶时,每来一个脉冲,路程模块加2ml当路程不超过3KmW,费用都是7元,当路程 超过3Km时,再判断费用是否达到20元,若小于20,则设路程变量aa,若aa 大于1Km则费用加0.22;若小于20,且aa大于1Km则费用加0.33;然后通 过转码模块,将费用和路程的个、十、十分位、百分位送到数码管上进行显示。动态扫描模块设计一个8进制计数器,每来一个脉冲自加 1。将输出接到38译码器上,用3

5、8译码器的输出作为数码管的选通信号。人眼的分辨率是50Hz,我们设置脉冲的频率大于50Hz,那么,8个数码管在人眼中,将同时处于选通状态,从而实现动 态扫描。3.3 设计框图四单元模块设计与分析4.1分频部分的设计分频1:library ieee;use ieee.std_logic_1164.all;entity oneMHZ isport( daclk:in std_logic;clkout:out std_logic);end oneMHZ;architecture one of oneMHZ issignal data:integer range 0 to 5000;signal Q:

6、std_logic;beginprocess(daclk)beginif daclkevent and daclk=1 thenif(data=5000) thendata=0;Q=not Q;elsedata=data+1;end if;end if;clkout=Q;end process;end one;分频1的仿真波形library ieee;use ieee.std_logic_1164.all;entity twoMHZ isport( daclk:in std_logic;clkout:out std_logic);end twoMHZ;architecture one of t

7、woMHZ issignal data:integer range 0 to 2000;signal Q:std_logic;beginprocess(daclk)beginif daclkevent and daclk=1 then if(data=2000) thendata=0;Q=not Q;elsedata=data+1;end if;end if;clkout=Q;end process;end one;分频2的仿真波形library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity ji

8、fei isport(clk,start,stop,pause,js:in std_logic;light:out std_logic;chefei,luc:out integer range 0 to 8000);end jifei;architecture one of jifei issignal d:std_logic;beginprocess(clk,start,stop,pause,js)variable a,b:std_logic;variable aa:integer range 0 to 100;variable chf,lc:integer range 0 to 8000;

9、variable c:integer range 0 to 30;beginif (clkevent and clk=1) thenif(stop =0) thenchf:=0;数字电路课程设计报告 b:=1;aa:=0;lc:=0;elsif(start=0)thenb:=0;d=100)thena:=1;aa:=0;d=30)thend=1;end if;end if;if(lc300)thennull;elsif(chf=2000 and a=1)thenchf:=chf+330;end if;end if;chefei=chf;luc=lc;light=d;end process;en

10、d one;4.3转码模块设计library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity x isport(daclk:in std_logic;ascore,bscore:in integer range 0 to 8000;age,ashi,abai,aqian,bge,bshi,bbai,bqian:out std_logic_vector(3 downto 0);end x;architecture one of x isbeginprocess(daclk,ascore)variabl

11、e c1:integer range 0 to 8000;variable c1a,c1b,c1c,c1d:std_logic_vector(3 downto 0);beginif(daclkevent and daclk=1)thenif(c1ascore)thenif(c1a=9 and c1b=9 and c1c=9 )thenc1ak0000;c1bk0000;c1c尸0000;c1d:=c1d+1;c1:=c1+1;elsif(c1a=9 and c1b=9 )thenc1ak0000;c1bk0000;c1c:=c1c+1;c1:=c1+1;elsif(c1a=9 )thenc1a

12、k0000;c1b:=c1b+1;c1:=c1+1;elsec1a:=c1a+1;c1:=c1+1;end if;elseage=c1a;ashi=c1b;abai=c1c;aqian=c1d;c1:=0;c1ak0000;c1bk0000;c1c尸0000;c1dk0000;end if;end if;end process;process(daclk,bscore)variable c2:integer range 0 to 8000;variable c2a,c2b,c2c,c2d:std_logic_vector(3 downto 0);beginif(daclkevent and d

13、aclk=1)thenif(c2bscore)thenif(c2a=9 and c2b=9 and c2c=9 )thenc2a:=0000;c2b:=0000;c2c:=0000;c2d:=c2d+1;c2:=c2+1;elsif(c2a=9 and c2b=9 )thenc2a:=0000;c2b:=0000;c2c:=c2c+1;c2:=c2+1;elsif(c2a=9 )thenc2a:=0000;c2b:=c2b+1;c2:=c2+1;elsec2a:=c2a+1;c2:=c2+1;end if;elsebge=c2a;bshi=c2b;bbai=c2c;bqian=c2d;c2:=0;c2a:=0000;c2b:=0000;c2c:=0000;c2d:=0000;end if;end if;end process;end one;转码的仿真波形

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业/管理/HR > 营销创新

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号