background image

电梯控制器 VHDL 程序与仿真。

--

--文件名:dianti.vhd。
--功能:6 层楼的电梯控制系统。
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity dianti is 

port ( clk : in std_logic;                       --时钟信号(频率为 2Hz)

       full,deng,quick,clr : in std_logic;         --超载、关门中断、提前关门清除报警信号
       c_u1,c_u2,c_u3,c_u4,c_u5: in std_logic;    --电梯外人的上升请求信号
       c_d2,c_d3,c_d4,c_d5,c_d6 : in std_logic;   --电梯外人的下降请求信号
       d1,d2,d3,d4,d5,d6 : in std_logic;          --电梯内人的请求信号
       g1,g2,g3,g4,g5,g6 : in std_logic;          --到达楼层信号
       door : out std_logic_vector(1 downto 0);    --电梯门控制信号
       led : out std_logic_vector(6 downto 0);     --电梯所在楼层显示

   led_c_u:out std_logic_vector(5 downto 0);  --电梯外人上升请求信号显示

       led_c_d:out std_logic_vector(5 downto 0);  --电梯外人下降请求信号显示