全文预览

《出租车计费系统-VHDL》.doc

上传者:科技星球 |  格式:doc  |  页数:16 |  大小:0KB

文档介绍
=9)b2a:="0000"; comb2b:=comb2b+1; comb2:=comb2+1; b2a:= comb2a+1; comb2:= comb2+1; end if; else bshi<=comb2b; bge<=comb2a; bbai<=comb2c; bqian<=comb2d; comb2:=0; comb2a:="0000"; comb2b:="0000"; comb2c:="0000"; comb2d:="0000"; end if; end if; end process; end rtl; (3)模块 XXX 1的实现: 模块 XXX1 见图 4.5。经过该八进制模块将车费和路程显示出来。 10 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity XXX1 is port(c:in std_logic_vector(2 downto 0); dp:out std_logic ;a1,a2,a3,a4,b1,b2,b3,b4:in std_logic_vector(3 downto 0); d:out std_logic_vector(3 downto 0)); end XXX1; architecture rtl ofxxx1 is begin process(c,a1,a2,a3,a4,b1,b2,b3,b4) b:std_logic_vector(2 downto 0); b:=c; b is When "000 "=>d<=a1; dp<= '0';When "001 "=>d<=a2; dp<= '0';When "010 "=>d<=a3; dp<= '1';when "011 "=>d<=a4; 图4.5模块 XXX1

收藏

分享

举报
下载此文档