基于vhdl出租车计价器设计说明书内容摘要:
0]c lk _s c anSE G[ 7. .0]D IP[ 7. .0]BC D 7ins t18 12 2. 各个模块的作用 ( 1) BCD7 模块: 输入 licheng信号和 money 信号转换成相应的七段数码管数据信号和地址信号输出 ( 2) C47 模块: 输入 second 数据信号、 minute 数据信号和 hour 数据信号转换成相应的七段数码管数据信号和地址信号输出 ; 当 hour 输入为 23~6 时, hourout 输出为 1,当 hour输入为 7~22 时, hourout 输出为 0。 3. 各个模块的程序 ( 1) BCD7 模块的程序及仿真: library ieee。 use。 use。 use。 entity BCD7 is port( Din1:in std_logic_vector(12 downto 0)。 显示 13 位里程数 Din2:in std_logic_vector(12 downto 0)。 13 位费用 clk_scan:in std_logic。 SEG:out std_logic_vector(7 downto 0)。 数码管显示 DIP:out std_logic_vector(7 downto 0))。 数码管地址 end BCD7。 architecture Arch of BCD7 is signal q : std_logic_vector(2 downto 0)。 signal Dq,Db,Ds,Dg,Dq2,Db2,Ds2,Dg2 : std_logic_vector(3 downto 0)。 signal data : std_logic_vector(3 downto 0)。 signal sel : std_logic_vector(2 downto 0)。 signal Din : std_logic_vector(12 downto 0)。 signal D2in : std_logic_vector(12 downto 0)。 signal i : std_logic。 begin P1: process(clk_scan) begin if(rising_edge(clk_scan)) then q=q+1。 end if。 end process P1。 P2: process(Din1) 进程 p2,里程显示 variable Din_int:integer range 0 to 9999。 variable rb:integer range 0 to 1000。 variable rs:integer range 0 to 100。 begin Din=Din1。 Din_int:=conv_integer(Din)。 把 din 变成整型变量 Dq=conv_std_logic_vector(Din_int/1000,4)。 里程的千位等于 Din_int 除以 1000 取整,并转换成 BCD rb:=Din_int rem 1000。 除以 1000后的 余数存放在 rb 13 Db=conv_std_logic_vector(rb/100,4)。 rb 除以 100,转换成 BCD存放在 Db中 rs:=rb rem 100。 Ds=conv_std_logic_vector(rs/10,4)。 Dg=conv_std_logic_vector(rs rem 10,4)。 end process P2。 P3:process(Din2) – 进程 p3,费用设置 variable Din_int2:integer range 0 to 9999。 variable rb2:integer range 0 to 1000。 variable rs2:integer range 0 to 100。 begin D2in=Din2。 Din_int2:=conv_integer(D2in)。 Dq2=conv_std_logic_vector(Din_int2/1000,4)。 rb2:=Din_int2 rem 1000。 Db2=conv_std_logic_vector(rb2/100,4)。 rs2:=rb2 rem 100。 Ds2=conv_std_logic_vector(rs2/10,4)。 Dg2=conv_std_logic_vector(rs2 rem 10,4)。 end process P3。 P4:process(q) 进程 P4,里程与费用的显示 begin sel=q(2)amp。 q(1)amp。 q(0)。 数码管地址 case sel is when 000=data= Dq。 DIP=10000000。 i=39。 139。 当 000 时,把数据存放在数码管的 10000000位,也就是最高位 when 001=data= Db。 DIP=01000000。 i=39。 139。 when 010=data= Ds。 DIP=00100000。 i=39。 139。 when 011=data= Dg。 DIP=00010000。 i=39。 139。 when 100=data= Dq2。 DIP=00001000。 i=39。 139。 when 101=data= Db2。 DIP=00000100。 i=39。 139。 when 110=data= Ds2。 DIP=00000010。 i=39。 139。 when 111=data= Dg2。 DIP=00000001。 i=39。 139。 when others=data=1111。 DIP=00000000。 i=39。 039。 end case。 end process P4。 P5:process(data,sel) 进程 p5,是否显示小数点 begin if((sel=010or sel=110) and i=39。 139。 )then 在 010 及 110时显示小数点 case data is when0000=SEG=11111101。 when0001=SEG=01100001。 when0010=SEG=11011011。 when0011=SEG=11110011。 when0100=SEG=01100111。 14 when0101=SEG=10110111。 when0110=SEG=10111111。 when0111=SEG=11100001。 when1000=SEG=11111111。 when1001=SEG=11100111。 when others=SEG=00000001。 end case。 else 否则不显示小数 点 case data is when0000=SEG=11111100。 when0001=SEG=01100000。 when0010=SEG=11011010。 when0011=SEG=11110010。 when0100=SEG=01100110。 when0101=SEG=10110110。 when0110=SEG=10111110。 when0111=SEG=11100000。 when1000=SEG=11111110。 when1001=SEG=11100110。 when others=SEG=00000000。 end case。 end if。 end process P5。 end Arch。 仿真波形如图 11: 图 11 ( 2) c47 模块的程序及仿真: library ieee。 use。 use。 use。 entity c47 is port( sec,min:in std_logic_vector(6 downto 0)。 hour:in std_logic_vector(5 downto 0)。 clk_scan:in std_logic。 SEG:out std_logic_vector(7 downto 0)。 DIP:out std_logic_vector(7 downto 0)。 15 hourout:out std_logic)。 end。 architecture one of c47 is signal q:std_logic_vector(2 downto 0)。 signal dig1,dig2,dig3,dig4:std_logic_vector(3 downto 0)。 signal dig5,dig6,dig7,dig8:std_logic_vector(3 downto 0)。 signal data: std_logic_vector(3 downto 0)。 signal sel:std_logic_vector(2 downto 0)。 begin P1: process(clk_scan) 进程 p1, 输入脉冲 Begin if(rising_edge(clk_scan)) then q=q+1。 上升沿加 1 end if。 end process P1。 P2: process(hour,min,sec) 进程 P2,时,分,秒的设置 begin dig1=00amp。 hour(5 downto 4)。 dia1 定义 4位,进行定义 dig2=hour(3 downto 0)。 dig3=1111。 dig4=39。 039。 amp。 min(6 downto 4)。 dig5=min(3 downto 0)。 dig6=1111。 dig7=39。 039。 amp。 sec(6 downto 4)。 dig8=sec(3 downto 0)。 end process P2。 P4:process(q) 进程 p4,显示时,分,秒 begin sel=q(2)amp。 q(1)amp。 q(0)。 case sel is when 000=data= dig1。 DIP=10000000。 当 000 时,数据放入地址 10000000 when 001=data= dig2。 DIP=01000000。 when 010=data= dig3。 DIP=00100000。 when 011=data= dig4。 DIP=00010000。 when 100=data= dig5。 DIP=00001000。 when 101=data= dig6。 DIP=00000100。 when 110=data= dig7。 DIP=00000010。 when 111=data= dig8。 DIP=00000001。 when others=data=1111。 DIP=00000000。 end case。 end process P4。 P5:process(data,sel) 进程 5,小数点是否显示 begin if(sel=001or sel=100)then 在 001 及 100时显示小数点 case data is 16 when0000=SEG=11111101。 when0001=SEG=01100001。 when0010=SEG=11011011。 when0011=SEG=11110011。 when0100=SEG=01100111。 when0101=SEG=10110111。 when0110=SEG=10111111。 when0111=SEG=11100001。 when1000=SEG=11111111。 when1001=SEG=11100111。 when others=SE。基于vhdl出租车计价器设计说明书
相关推荐
参考文献;致谢;附录。 正文章、节题目(理工类要求编写到第 3级标题,即□ .□ .□。 文科、管理类可视论文需要进行,编写到 2~3级标题。 ) 论文正文 章节及各章标题 论文正文分章、节撰写, 每章应另起一页。 各章标题要突出重点、简明扼要。 字数一般在 15字以内,不得使用标点符号。 标题中尽量不用英文缩写词,对必须采用者,应使用本行业的通用缩写词。 层次 层次以少为宜,根据实际需要选择。
号; recount:接收由交通灯信号控制电路产生的重新计数的使能控制信号; sign_state:接收由交通灯信号控制电路产生的状态信号。 系统输出信号: load:负责产生计数器所需要的计数数值。 图 35是计数秒数选择电路通过 Quartus II 软件仿真得到的仿真波形图。 2020届本科生毕业论文(设计) 10 图 35 计数秒数选择电路时序图 由计数描述选择电路的时序图 (见图
误,尤其是当我设计 day 模块时,对应不同年份,不同的月份,需要分多种情况,所以在这设计过程中用到了很多 if 语句,当编译时总会提示出有错误,后来经过不断编译不断修改提示错误后最终完成了 day 模块的设计。 刚开始时,我是先从比较熟练的 Quartus II 入手,当所有的设计模块都编译成功后再进一步运用 modelsim进行波形仿真,在开始编写 testbench 时,感到有些难度
略 学术刊物文献 序号 └─┘ 作者.文章名.学术刊物名.年,卷(期):引用部分起止页 学术会议文献 序号 └─┘ 作者.文章名.编者名.会议名称,会议地址,年份.出版地,出版者, 出版年 :引用部分起止页 学位论文类参考文献 序号 └─┘ 研究生名.学位论文 题目.出版地.学校(或研究单位)及学位论文级别.答 辩年份 :引用部分起止页 西文文献中第一个词和每个实词的第一个字母大写,余者小写
ument()来获取其所对应的 Document 文档数据。 (三)文挡操作 由于 MFC 机制设计出文档类对象专门负责数据的 I/O 存取和数据的运算和操作等。 一般来说 ,数据运算是通过 Document 类里面的扩展功能来实现的 ,这样做可以 形成一种密集数据处理 ,达到方便易用和管理的好处。 对于一个文件而言 ,如果文件内对象的排列顺序是固定的
lay 的地址是一个 URL 字符串,由如下格式构成: xdirectplay:/[data string] 在不同的网络连接上,它包含发送消息方和接受方这样的元素。 DirectPlay 对象之间的通信 DirectPlay 是基于 COM 的,而各个组件管理不同的方面,例如, DirectPlay点 (peer)对象 (CLSID_DirectPlay8Peer)就是负责管理点对点游戏的。