程序设计与仿真。
1. 出租车计价器VHDL程序
--文件名:taxi.hd
--功能:出租车计价器
--最后修改日期:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity taxi is
port ( clk_240 :in std_logic; --频率为240Hz的时钟
start :in std_logic; --计价使能信号
stop:in std_logic; --等待信号
fin:in std_logic; --公里脉冲信号
cha3,cha2,cha1,cha0:out std_logic_vector(3 downto 0); --费用数据
km1,km0:out std_logic_vector(3 downto 0); --公里数据
min1,min0: out std_logic_vector(3 downto 0)); --等待时间
end taxi;
architecture behav of taxi is
signal f_15,f_16,f_1:std_logic; --频率为15Hz,16Hz