三层电梯控制vhdl语言.docVIP

  1. 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
三层电梯控制vhdl语言

library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all; entity threelift12345 is--实体 port buttonclk:in std_logic; --按键时钟信号 liftclk:in std_logic; --电梯时钟信号 reset:in std_logic; --异步复位端口 f1upbutton:in std_logic; --一层上升请求端口 f2upbutton:in std_logic; --二层上升请求端口 f2dnbutton:in std_logic; --二层下降请求端口 f3dnbutton:in std_logic; --三层下降请求端口 stop1button:in std_logic; --一层停站请求端口 stop2button:in std_logic; --二层停站请求端口 stop3button:in std_logic; --三层停站请求端口 position:buffer integer range 1 to 3; --电梯位置信号 udsig:buffer std_logic; --电梯模式(上升或下降)信号 fuplight,fdnlight,stoplight:buffer std_logic_vector 3 downto 1 ;--上升、下降、停站请求寄存信号 doorlight:out std_logic; --开关门信号 dout1:out std_logic_vector 2 downto 0 ; end entity; architecture art of threelift12345 is --结构体 type lift_state is ---定义十个状态 stopon1,dooropen,doorclose,doorwait1,doorwait2,doorwait3,doorwait4,up,down,stop ; signal mylift:lift_state; signal clearup:std_logic; --上升和停站请求清除信号 signal cleardn:std_logic;---下降和停站请求清除信号 begin process reset,liftclk is--状态机进程 variable pos:integer range 3 downto 1; begin if reset 1 then ----异步复位,电梯的初始状态为一层开门状态 mylift stopon1;clearup 0;cleardn 0; else if liftclkevent and liftclk 1 then mylift doorwait1; case mylift is when stopon1 doorlight 1;position 1; pos: 1; mylift doorwait1;--电梯等待4s when doorwait1 mylift doorwait2; when doorwait2 clearup 0;cleardn 0;mylift doorwait3; when doorwait3 mylift doorwait4; when doorwait4 mylift doorclose; when doorclose ---关门,判定电梯下一个运行方式 doorlight 0; if udsig 1 then--电梯处在上升模式 if position 3 then if fuplight 000 and fdnlight 000 and stoplight 000 then--没有请求信号时,电梯停在当前层 udsig 0;mylift doorclose; elsif fdnlight 3 1 or stoplight 3 1 then --本层有请求信号是,电梯开门 udsig 0;mylift dooropen; else --否则下降 udsig 0;mylift down; end if; elsif position 2 then if fuplight 000 and fdnlight 000 and stoplight 000 then udsig 1;mylift doorclose; elsif fuplight 2 1 or stoplight 2 1 then--本层有上升或停站请求

文档评论(0)

tiangou + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档