三层电梯控制器综合版

--quartus 2 编写 输出为数码管 直接编译就可以 FPGA library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

entity lift is

port (floor_1_up,floor_2_up,floor_2_down,floor_3_down:in std_logic; floor1,floor2,floor3:in std_logic;

clk:in std_logic;

floor_num:out std_logic_vector(6 downto 0);

direct:out std_logic_vector(6 downto 0);

open_close: out std_logic);

end;

architecture bev_lift of lift is

signal up:std_logic_vector(3 downto 1);

signal down:std_logic_vector(3 downto 1);

signal now_num:integer range 1 to 3;

signal flag:integer range 0 to 1;

signal run:integer range 0 to 1;

signal show_direct:integer;

signal OC:integer;

signal up_c:std_logic_vector(3 downto 1);

signal down_c:std_logic_vector(3 downto 1);

begin

control:process(floor_1_up,floor_2_up,floor_2_down,floor_3_down,clk, floor1,floor2,floor3)

variable up_v:std_logic_vector(3 downto 1):="000"; variable down_v:std_logic_vector(3 downto 1):="000"; begin

if(clk'event and clk='1') then

up_v:="000";

down_v:="000";

if(floor_1_up='1') then

up_v(1):='1';end if;

if(floor_2_up='1') then

up_v(2):='1';end if;

if(floor_2_down='1') then

down_v(2):='1';end if;

if(floor_3_down='1') then

down_v(3):='1';end if;

if(floor1='1') then

if(now_num>1) then

down_v(1):='1';

end if;

end if;

if(floor2='1') then

if(now_num>2) then

down_v(2):='1';end if;

if(now_num

up_v(2):='1'; end if;

end if;

if(floor3='1') then

if(now_num

up_v(3):='1';end if;

end if;

end if;

if(clk'event and clk='1') then

up_c

down_c

end if;

end process;

go:process(clk)

variable now_num_v :integer range 0 to 4:=1;

variable next_num_v :integer range 0 to 4:=1;

variable flag_v: integer range 0 to 1;

variable clear: integer range 0 to 1:=0;

variable delay:integer range 1 to 6:=1;

variable OC:integer range 0 to 1:=0;

variable first:integer range 0 to 1:=0;

variable next_num:integer range 1 to 3;

begin

if(clk'event and clk='0') then

up

down

if(flag=0) then

if(run=0) then

if(next_num_v>=1) then

if(down(next_num_v)='1') then run

next_num:=next_num_v; clear:=1;

first:=1;

else

next_num_v:=next_num_v-1; end if;

if(clear=1) then down(next_num_v)

up(next_num_v)3) then flag_v:=0; next_num_v:=3;end if; end if; end if; end if; flagnext_num) then show_direct

end if;

if(OC=1) then

open_close

delay:=delay+1;

if(delay=6) then

delay:=1;

open_close

next_num_v:=now_num; run

end if;

end if;

end if;

end process;

dir:process(show_direct)

variable n:integer range 1 to 2;

begin

case show_direct is

when 1 =>directdirect

when others =>direct

end process;

show_num:process(clk)

begin

case now_num is

when 1 =>floor_numfloor_numfloor_num

when others =>floor_num

end process;

end architecture;

--quartus 2 编写 输出为数码管 直接编译就可以 FPGA library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all;

entity lift is

port (floor_1_up,floor_2_up,floor_2_down,floor_3_down:in std_logic; floor1,floor2,floor3:in std_logic;

clk:in std_logic;

floor_num:out std_logic_vector(6 downto 0);

direct:out std_logic_vector(6 downto 0);

open_close: out std_logic);

end;

architecture bev_lift of lift is

signal up:std_logic_vector(3 downto 1);

signal down:std_logic_vector(3 downto 1);

signal now_num:integer range 1 to 3;

signal flag:integer range 0 to 1;

signal run:integer range 0 to 1;

signal show_direct:integer;

signal OC:integer;

signal up_c:std_logic_vector(3 downto 1);

signal down_c:std_logic_vector(3 downto 1);

begin

control:process(floor_1_up,floor_2_up,floor_2_down,floor_3_down,clk, floor1,floor2,floor3)

variable up_v:std_logic_vector(3 downto 1):="000"; variable down_v:std_logic_vector(3 downto 1):="000"; begin

if(clk'event and clk='1') then

up_v:="000";

down_v:="000";

if(floor_1_up='1') then

up_v(1):='1';end if;

if(floor_2_up='1') then

up_v(2):='1';end if;

if(floor_2_down='1') then

down_v(2):='1';end if;

if(floor_3_down='1') then

down_v(3):='1';end if;

if(floor1='1') then

if(now_num>1) then

down_v(1):='1';

end if;

end if;

if(floor2='1') then

if(now_num>2) then

down_v(2):='1';end if;

if(now_num

up_v(2):='1'; end if;

end if;

if(floor3='1') then

if(now_num

up_v(3):='1';end if;

end if;

end if;

if(clk'event and clk='1') then

up_c

down_c

end if;

end process;

go:process(clk)

variable now_num_v :integer range 0 to 4:=1;

variable next_num_v :integer range 0 to 4:=1;

variable flag_v: integer range 0 to 1;

variable clear: integer range 0 to 1:=0;

variable delay:integer range 1 to 6:=1;

variable OC:integer range 0 to 1:=0;

variable first:integer range 0 to 1:=0;

variable next_num:integer range 1 to 3;

begin

if(clk'event and clk='0') then

up

down

if(flag=0) then

if(run=0) then

if(next_num_v>=1) then

if(down(next_num_v)='1') then run

next_num:=next_num_v; clear:=1;

first:=1;

else

next_num_v:=next_num_v-1; end if;

if(clear=1) then down(next_num_v)

up(next_num_v)3) then flag_v:=0; next_num_v:=3;end if; end if; end if; end if; flagnext_num) then show_direct

end if;

if(OC=1) then

open_close

delay:=delay+1;

if(delay=6) then

delay:=1;

open_close

next_num_v:=now_num; run

end if;

end if;

end if;

end process;

dir:process(show_direct)

variable n:integer range 1 to 2;

begin

case show_direct is

when 1 =>directdirect

when others =>direct

end process;

show_num:process(clk)

begin

case now_num is

when 1 =>floor_numfloor_numfloor_num

when others =>floor_num

end process;

end architecture;


相关内容

  • BR-PFE系列电梯回馈制动单元
  • 1. 产品概述 BR-PFE 系列电梯回馈制动单元,是采用最新技术生产制造的电梯专用高性能回馈式制动单元.升降电梯在使用电梯回馈节能产品后,能有效的将电容中储存的直流电能转换成交流电能回送到电网.节电率达25%- 45%.此外,由于无电阻发热元件,降低了机房的环境温度,同时也改善了电梯控制系统的运行 ...

  • 百问百答(BA)
  • 关于BA接口的若干问题 问:什么是BA接口? 答:BA(Building Automation system的简称)或BMS(Building Manage System)是大楼管理系统的简称,一般来说大楼管理系统需要监视大楼里的所有电气设备(如供电设备.中央空调.水泵.电梯等)的运行状态,了解这些 ...

  • 电梯控制系统 PLC 哈工大
  • H a r b i n I n s t i t u t e o f T e c h n o l o g y 课程设计说明书(论文) 课程名称: 设计题目: 院 系: 班 级: 设 计 者: 学 号:指导教师: 设计时间:哈尔滨工业大学 哈尔滨工业大学课程设计任务书 *注:此任务书由课程设计指导教师填 ...

  • 日立电梯优势特点介绍
  • 日立电梯优势特点介绍 一. 企业优势 ● 日立电梯(中国)有限公司2006年电梯销量以22000台据全国第一 ● 日立电梯(中国)有限公司为亚洲最大的日立电梯生产加工基地和全国最大的电梯生产 企业之一 ● 四川日立(日立电梯(中国)有限公司分支机构) 为西南地区规模最大的专业电梯公司 ● 全国电梯行 ...

  • 建筑电气工程监理要求
  • 建筑电气工程.智能建筑工程.电梯工程是建筑工程的三个重要分部工程.加强对这三个分部工程施工过程的质量控制和施工质量验收,是监理的重要任务.近年来,随着建筑业的发展和国家新一轮工程质量验收标准.规范的实行.2002年新版强制性条文的实施,对监理工作提出了更高的要求.为了适应当前的形势,满足监理工作者. ...

  • 电工.电梯工职工职业技能竞赛试题
  • 职工技能竞赛 工种等级:电梯安装维修工高级 理论知识竞赛试卷C 完成时间:60分钟 一.选择题(请将正确答案的代号填入答卷对应的序号下,每题0.5分,共80分) 1.用电弧焊焊接薄工件时,运条的方法应该( ). (A )直线匀速移动 (B )不停地横向摆动 (C )直线来回往复移动 (D )上下不停 ...

  • 高层建筑电梯配置分析
  • [摘 要]由于高层建筑在节约城市用地.提升城市形象等方面有着独特的作用和意义,随着经济的高速发展,抗震技术.防火技术.施工技术的提高和完善,超高层建筑在我国必将不断涌现.作为高层建筑的附属设施电梯,为现代化高层建筑发挥巨大作用而彰显出异常的优势: 建筑师有必要了解超高层电梯系统优化配置的基本参数,掌 ...

  • 五星级酒店工程部应急预案
  • 酒店工程部应急预案 1总则: 本预案针对对酒店内发生火灾.防汛.电梯困人.停水.停煤气.煤气泄漏.停电.触电.漏水.停蒸汽等紧急情况时,工程部采取的应急措施予以表述,为了规范应急事件的应对管理,特制定本预案,请各位专业人士参考指导,如有雷同纯属巧合. 2工程部火灾扑救预案 2.1在工程部管辖范围内的 ...

  • 工程部应急预案
  •   工程部应急预案   1总则   本程序对饭店内发生火灾、防汛、电梯困人、停水、停煤气、煤气泄漏、停电、触电、漏水、停蒸汽等紧急情况时,工程部采取的应急措施予以表述,为了规范应急事件的应对管理,特制定本程序。   2工程部火灾扑救预案   2.1在工程部管辖范围内的各机房或工作区域发生火灾,发现人 ...

  • 专业定位与办学思路
  • 专业定位与办学思路 一 专业定位 本专业经过广泛的前期调研,于2007年开始招生,以培养机电设备操作工.安装调试员.维修工为目标,侧重于操作工与维修工. 随着现代化工业生产的发展,自动化控制技术的集成应用正起着越来越重要的作用.由于气动技术.液压技术.传感器技术.PLC技术.网络及通讯技术等学科的强 ...