ImageVerifierCode 换一换
格式:DOCX , 页数:14 ,大小:89.04KB ,
资源ID:22150832      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/22150832.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(出租车计费器VHDL语言Word格式文档下载.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

出租车计费器VHDL语言Word格式文档下载.docx

1、out std_logic);end Taxi_part1;architecture behavior of Taxi_part1 isbegin process(clk,reset,stop,start,sp) type state_type is(s0,s1); variable s_state:state_type; variable cnt:integer range 0 to 1400; variable kinside: case sp is when 000= kinside:=0;001=1400;010=1200;011=1000;100=800;101=600;110=40

2、0;111=200; end case; if(reset=1) then s_state:=s0; elsif(clkevent and clk=) then case s_state is when s0= cnt:clkout clkout if(stop= -相当于无客户上车 elsif(sp= -有客户上车,但车速位0,即客户刚上车还未起步 elsif(cnt=kinside) then cnt: s_state: else cnt:=cnt+1; end process;end behavior;2.计程模块:由于一个clkout信号代表行进100m,故通过对clkout计数,可以

3、获得共行进的距离kmcount。entity Taxi_part2 is port(clkout,reset: kmcnt1:out std_logic_vector(3 downto 0); kmcnt2: kmcnt3:out std_logic_vector(3 downto 0);end Taxi_part2;architecture behavior of Taxi_part2 is process(clkout,reset) variable km_reg:std_logic_vector(11 downto 0);) then km_reg:=0 elsif(clkouteven

4、t and clkout=) then -km_reg(3 downto 0)对应里程十分位 if(km_reg(3 downto 0)=1001)then km_reg:=km_reg+0111 -十分位向个位的进位处理 else km_reg(3 downto 0):=km_reg(3 downto 0)+0001 if(km_reg(7 downto 4)=101001100000 -个位向十位的进位处理end if;kmcnt1=km_reg(3 downto 0);kmcnt2=km_reg(7 downto 4);kmcnt3 waittime:timecount if(sp=t2

5、; else waittime:t_state: when t2 =waittime+1; timecount if(waittime=1000) then -20s,即1000个clk,产生一个时间计费脉冲 elsif(stop= else timecount) then price0100 else Price0011)or(kmcnt3) then Enable else Enablekmmoney2:process(reset,clkout,clk,Enable,Price,kmcnt2)variable reg2:variable clkout_cnt:integer range 0

6、 to 10;) then cash reg2(7 downto 0):=reg2(7 downto 0)+00000111 if(reg2(7 downto 4) cash =reg2+ else cash0000100100000110+price; cash=reg2+price; else clkout_cnt:=clkout_cnt+1;count1=cash(3 downto 0); -总费用的个位count2=cash(7 downto 4); -总费用的十位count3=cash(11 downto 8); -总费用的百位5.显示模块:时间的显示需要用到全部8个数码管,由于实验

7、板上的所有数码管均对应同一组7段码,因此,需要采用动态扫描的方式实现时间显示。entity display isport(clk: kmcount1: kmcount2: kmcount3: clkout:out std_logic_vector(6 downto 0); sel:buffer std_logic_vector(2 downto 0);end display;architecture dtsm of display is signal key: process(clk) variable dount:std_logic_vector(2 downto 0): if rising_edge(clk) then if dount= then dount: else =dount+1; sel=dount; process(sel) case sel iskeynull; process(key) case key is01111110000110101101110011111100110010111011010110111110100001111000111111111011111000000end dtsm;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1