ImageVerifierCode 换一换
格式:DOC , 页数:11 ,大小:18.39KB ,
资源ID:9447393      下载积分:10 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/9447393.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(八层电梯主控程序-VHDL程序编写.doc)为本站上传会员【仙人****88】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

八层电梯主控程序-VHDL程序编写.doc

1、LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_arith.all; USE ieee;std_logic_unsigned.all; ENTITY lift IS port(buttonclk : IN STD_LOGIC; --按键时钟 liftclk : IN STD_LOGIC; --电梯时钟 reset : in STD_LOGIC; --异步复位 input : in std_logic; up : in std_logic

2、vector(3 downto 0); down : in std_logic_vector(3 downto 0); stop: in std_logic_vector(3 downto 0); fuplight : buffer std_logic_vector(8 downto 1);--电梯外部上升请求指示灯 fdnlight: buffer std_logic_vector(8 downto 1);--电梯外部下降请求指示灯 stoplight: buffer std_logic_vector(8 downto 1);--电梯内部各层请求指示灯 position: bu

3、ffer integer range 1 to 8;--电梯位置指示 doorlight: out std_logic;--电梯开关指示灯 udsig: buffer std_logic);--电梯升降指示 end lift; architecture a of lift is TYPE lift_state is (stopon1,dooropen,doorclose,doorwait1,doorwait2,doorwait3,doorwait4,up,down,stop); signal mylift: lift_state; signal clearup: STD_L

4、OGIC;--用于清除上升请求指示灯的信号 signal cleardn: STD_LOGIC;--用于清除下降请求指示灯的信号 signal f1upbutton: std_logic; signal f2upbutton: std_logic; signal f2dnbutton: std_logic; signal f3dnbutton: std_logic; signal f3upbutton: std_logic; signal f4dnbutton: std_logic; signal f4upbutton: std_logic; signal f5

5、dnbutton: std_logic; signal f5upbutton: std_logic; signal f6dnbutton: std_logic; signal f6upbutton: std_logic; signal f7dnbutton: std_logic; signal f7upbutton: std_logic; signal f8dnbutton: std_logic; signal stop1button,stop2button,stop3button,stop4button,stop5button,stop6button,stop7b

6、utton,stop8button: std_logic; begin ctrlift: process(reset,liftclk)--控制电梯状态的进程 variable poss: integer range 8 downto 1;--变量poss用于表示电梯的位置 begin if reset='1' then --异步复位信号如果为1时电梯的状态 mylift<=stopon1; --如果电梯停留在第一层待机 clearup<='0'; --清除上升信号 cleardn<='0'

7、 --清除下降信号 else --电梯处于正常工作情况 if liftclk'event and liftclk='1' then --电梯时钟上升沿触发 case mylift IS when stopon1 => --处于电梯停留在一层的状态 doorlight<='1'; --开门指示灯亮表示开门 position<=1;poss:=1; --电梯位置为一层 mylift<=doorwait1; --状态转移

8、到开门等待第一秒状态 when doorwait1 => --处于开门等待第一秒状态 mylift<=doorwait2; --状态转移到开门等待第二秒状态 when doorwait2 => --处于开门等待第二秒状态 clearup<='0'; --清除本层上升请求 cleardn<='0'; --清除本层下降请求 mylift<=doorwait3; --状态转移到开门等待第三秒状态 when doorwait3 =>

9、 --处于开门等待第三秒状态 mylift<=doorwait4; --状态转移到开门等待第四秒状态 when doorwait4 => --处于开门等待第四秒状态 mylift<=doorclose; --状态转移到关门状态 when doorclose => --处于关门状态 doorlight<='0'; --开门指示灯灭,表示关门 if udsig='0' then --udsig=0表示上升模式 if position=8 then

10、 --如果电梯在第八层 if (stoplight="00000000" and fuplight="00000000") and fdnlight="00000000" then --没有任何请求信号 udsig<='1'; --udsig置1 mylift<=doorclose; --电梯处于关门状态 else udsig<='1'; mylift<=down;--无论什么请求电梯都要下降 end if; elsif position=7 then --

11、如果电梯在第七层 if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then --没有任何请求信号 udsig<='0'; mylift<=doorclose; --电梯回关门状态等待升降请求 elsif stoplight(8)='1' OR (stoplight(8)='0' and fdnlight(8)='1') then --如果内部有8层停站请求或有8层下降请求 udsig<='0'; my

12、lift<=up; --电梯上升 else udsig<='1'; mylift<=down; --其他任何情况udsig=1,电梯下降 end if; elsif position=6 then --如果电梯在第六层 if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='0'; --如果没有任何请求信号,电梯处于上升模式 mylift<=doorclose; --电梯回关门状态等待升降请求

13、elsif stoplight(7)='1' OR (stoplight(7)='0' and (fdnlight(7)='1' or fuplight(7)='1')) then --如果内部有7层停站请求或有7层上升、下降请求 udsig<='0'; mylift<=up; --电梯上升 elsif stoplight(8)='1' OR (stoplight(8)='0' and fdnlight(8)='1') then --如果内部有8层停站请求或有8层下降请求 udsig<='0';mylift

14、<=up; --电梯上升 else udsig<='1'; mylift<=down; --其他任何情况udsig=1,电梯下降 end if; elsif position=5 then --如果电梯在第五层 if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='0'; --如果没有任何请求信号,电梯处于上升模式 mylift<=doorclose; --电梯回关门状态等待升降请求 e

15、lsif stoplight(6)='1' OR (stoplight(6)='0' and (fdnlight(6)='1' or fuplight(6)='1')) then --如果内部有6层停站请求或有6层上升、下降请求 udsig<='0';mylift<=up; --电梯上升 elsif stoplight(7)='1' OR (stoplight(7)='0' and (fdnlight(7)='1' or fuplight(7)='1')) then --如果内部有7层停站请求或有7层上升、下降请求 udsig<='0';mylift<=u

16、p; --电梯上升 elsif stoplight(8)='1' OR (stoplight(8)='0' and fdnlight(8)='1') then --如果内部有8层停站请求或有8层下降请求 udsig<='0';mylift<=up; --电梯上升 else udsig<='1'; mylift<=down; --其他任何情况udsig=1,电梯下降 end if; elsif position=4 then --如果电梯在第四层 if stopligh

17、t="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='0'; --如果没有任何请求信号,电梯处于上升模式 mylift<=doorclose; --电梯回关门状态等待升降请求 elsif stoplight(5)='1' OR (stoplight(5)='0' and (fdnlight(5)='1' or fuplight(5)='1')) then --如果内部有5层停站请求或有5层上升、下降请求 udsig<='0';mylift<=up;

18、 --电梯上升 elsif stoplight(6)='1' OR (stoplight(6)='0' and (fdnlight(6)='1' or fuplight(6)='1')) then --如果内部有6层停站请求或有6层上升、下降请求 udsig<='0';mylift<=up; --电梯上升 elsif stoplight(7)='1' OR (stoplight(7)='0' and (fdnlight(7)='1' or fuplight(7)='1')) then --如果内部有7层停站请求或有7层上升、下降请

19、求 udsig<='0';mylift<=up; --电梯上升 elsif stoplight(8)='1' OR (stoplight(8)='0' and fdnlight(8)='1')then --如果内部有8层停站请求或有8层下降请求 udsig<='0';mylift<=up; --电梯上升 else udsig<='1'; mylift<=down; --其他任何情况udsig=1,电梯下降 end if; elsif position=3 then -

20、如果电梯在第四层 if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='0'; mylift<=doorclose; elsif stoplight(4)='1' OR (stoplight(4)='0' and (fdnlight(4)='1' or fuplight(4)='1')) then udsig<='0'; mylift<=up; elsif stoplight(5)='1' OR (stoplight(5)='0' and (fdnlight(5)

21、'1' or fuplight(5)='1')) then udsig<='0'; mylift<=up; elsif stoplight(6)='1' OR (stoplight(6)='0' and (fdnlight(6)='1' or fuplight(6)='1')) then udsig<='0'; mylift<=up; elsif stoplight(7)='1' OR (stoplight(7)='0' and (fdnlight(7)='1' or fuplight(7)='1')) then udsig<='0'; mylift<=up; elsif

22、stoplight(8)='1' OR (stoplight(8)='0' and fdnlight(8)='1') then udsig<='0'; mylift<=up; else udsig<='1'; mylift<=down; end if; elsif position=2 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='0'; mylift<=doorclose; elsif stoplight(3)='1' OR (

23、stoplight(3)='0' and (fdnlight(3)='1' or fuplight(3)='1')) then udsig<='0'; mylift<=up; elsif stoplight(4)='1' OR (stoplight(4)='0' and (fdnlight(4)='1' or fuplight(4)='1')) then udsig<='0'; mylift<=up; elsif stoplight(5)='1' OR (stoplight(5)='0' and (fdnlight(5)='1' or fuplight(5)='1')) then

24、 udsig<='0'; mylift<=up; elsif stoplight(6)='1' OR (stoplight(6)='0' and (fdnlight(6)='1' or fuplight(6)='1')) then udsig<='0'; mylift<=up; elsif stoplight(7)='1' OR (stoplight(7)='0' and (fdnlight(7)='1' or fuplight(7)='1')) then udsig<='0'; mylift<=up; elsif stoplight(8)='1' OR (stoplight(

25、8)='0' and fdnlight(8)='1') then udsig<='0'; mylift<=up; else udsig<='1'; mylift<=down; end if; elsif position=1 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='0'; mylift<=doorclose; else udsig<='0'; mylift<=up; end if; end if; else -----

26、 if position=1 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='0'; mylift<=doorclose; else udsig<='0'; mylift<=up; end if; elsif position=2 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then

27、udsig<='1'; mylift<=doorclose; elsif stoplight(1)='1' OR (stoplight(1)='0' and fuplight(1)='1') then udsig<='1'; mylift<=down; else udsig<='0'; mylift<=up; end if; elsif position=3 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='1'; mylift<=d

28、oorclose; elsif stoplight(2)='1' OR (stoplight(2)='0' and (fuplight(2)='1' or fdnlight(2)='1')) then udsig<='1';mylift<=down; elsif stoplight(1)='1' OR (stoplight(1)='0' and fuplight(1)='1') then udsig<='1';mylift<=down; else udsig<='0'; mylift<=up; end if; elsif position=4 then if stop

29、light="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='1'; mylift<=doorclose; elsif stoplight(3)='1' OR (stoplight(3)='0' and (fuplight(3)='1' or fdnlight(3)='1')) then udsig<='1';mylift<=down; elsif stoplight(2)='1' OR (stoplight(2)='0' and (fuplight(2)='1' or fdnlight(2

30、)='1')) then udsig<='1';mylift<=down; elsif stoplight(1)='1' OR (stoplight(1)='0' and fuplight(1)='1') then udsig<='1';mylift<=down; else udsig<='0'; mylift<=up; end if; elsif position=5 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='1'; mylif

31、t<=doorclose; elsif stoplight(4)='1' OR (stoplight(4)='0' and (fuplight(4)='1' or fdnlight(4)='1')) then udsig<='1';mylift<=down; elsif stoplight(3)='1' OR (stoplight(3)='0' and (fuplight(3)='1' or fdnlight(3)='1')) then udsig<='1';mylift<=down; elsif stoplight(2)='1' OR (stoplight(2)='0' and (

32、fuplight(2)='1' or fdnlight(2)='1')) then udsig<='1';mylift<=down; elsif stoplight(1)='1' OR (stoplight(1)='0' and fuplight(1)='1') then udsig<='1';mylift<=down; else udsig<='0'; mylift<=up; end if; elsif position=6 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000

33、000" then udsig<='1'; mylift<=doorclose; elsif stoplight(5)='1' OR (stoplight(5)='0' and (fuplight(5)='1' or fdnlight(5)='1')) then udsig<='1';mylift<=down; elsif stoplight(4)='1' OR (stoplight(4)='0' and (fuplight(4)='1' or fdnlight(4)='1')) then udsig<='1';mylift<=down; elsif stoplight(3)='

34、1' OR (stoplight(3)='0' and (fuplight(3)='1' or fdnlight(3)='1')) then udsig<='1';mylift<=down; elsif stoplight(2)='1' OR (stoplight(2)='0' and (fuplight(2)='1' or fdnlight(2)='1')) then udsig<='1';mylift<=down; elsif stoplight(1)='1' OR (stoplight(1)='0' and fuplight(1)='1') then udsig<='1';my

35、lift<=down; else udsig<='0'; mylift<=up; end if; elsif position=7 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='1'; mylift<=doorclose; elsif stoplight(6)='1' OR (stoplight(6)='0' and (fuplight(6)='1' or fdnlight(6)='1')) then udsig<='1';mylift

36、<=down; elsif stoplight(5)='1' OR (stoplight(5)='0' and (fuplight(5)='1' or fdnlight(5)='1')) then udsig<='1';mylift<=down; elsif stoplight(4)='1' OR (stoplight(4)='0' and (fuplight(4)='1' or fdnlight(4)='1')) then udsig<='1';mylift<=down; elsif stoplight(3)='1' OR (stoplight(3)='0' and (fuplig

37、ht(3)='1' or fdnlight(3)='1')) then udsig<='1';mylift<=down; elsif stoplight(2)='1' OR (stoplight(2)='0' and (fuplight(2)='1' or fdnlight(2)='1')) then udsig<='1';mylift<=down; elsif stoplight(1)='1' OR (stoplight(1)='0' and fuplight(1)='1') then udsig<='1';mylift<=down; else udsig<='0'; mylif

38、t<=up; end if; elsif position=8 then if stoplight="00000000" and fuplight="00000000" and fdnlight="00000000" then udsig<='1'; mylift<=doorclose; else udsig<='1'; mylift<=down; end if; end if; end if;------------ when up => position<=position+1; poss:=poss+1; if poss=8 and (sto

39、plight(poss)='1' OR fdnlight(poss)='1') then mylift<=stop; elsif poss<8 and (stoplight(poss)='1' or fuplight(poss)='1') then mylift<=stop; --elsif((fdnlight(poss)='1' and fuplight(poss+1 to 8)=0 and) fdnlight(poss+1 to 8)=0) --then mylift<=stop; Else mylift<=doorclose; end if; when down =>

40、 position<=position-1; poss:=poss-1; if poss>1 and (stoplight(poss)='1' OR fdnlight(poss)='1') then mylift<=stop; elsif poss=1 and (stoplight(poss)='1' OR fuplight(poss)='1') then mylift<=stop; Else mylift<=doorclose; end if; when stop => mylift<=dooropen; when dooropen=> doorlight<='1

41、'; if udsig='0' then if position<=7 and (stoplight(position)='1' OR fuplight(position)='1') then clearup<='1'; else clearup<='1'; cleardn<='1'; end if; elsif udsig='1' then if position>=2 and (stoplight(position)='1' OR fdnlight(position)='1') then cleardn<='1'; else clearup<='1'; cleardn<=

42、'1'; end if; end if; mylift<=doorwait1; end CASE; end if; end if; end process ctrlift; process(reset,buttonclk) begin if reset='1' then f1upbutton<='0';f2upbutton<='0'; f2dnbutton<='0'; f3dnbutton<='0'; f3upbutton<='0'; f4dnbutton<='0'; f4upbutton<='0'; f5dnbutton<='0'; f5upbutt

43、on<='0'; f6dnbutton<='0'; f6upbutton<='0'; f7dnbutton<='0'; f7upbutton<='0'; f8dnbutton<='0'; stop1button<='0';stop2button<='0'; stop3button<='0';stop4button<='0'; stop5button<='0';stop6button<='0'; stop7button<='0';stop8button<='0'; else if buttonclk'event and buttonclk='1' then if inp

44、ut='1' then case up is when "0001"=> f1upbutton<='1'; when "0010"=> f2upbutton<='1'; when "0011"=> f3upbutton<='1'; when "0100"=> f4upbutton<='1'; when "0101"=> f5upbutton<='1'; when "0110"=> f6upbutton<='1'; when "0111"=> f7upbutton<='1'; when others => null; end case; case down is when

45、 "0010"=> f2dnbutton<='1'; when "0011"=> f3dnbutton<='1'; when "0100"=> f4dnbutton<='1'; when "0101"=> f5dnbutton<='1'; when "0110"=> f6dnbutton<='1'; when "0111"=> f7dnbutton<='1'; when "1000"=> f8dnbutton<='1'; when others => null; end case; case stop is when "0001"=> stop1button<='1';

46、when "0010"=> stop2button<='1'; when "0011"=> stop3button<='1'; when "0100"=> stop4button<='1'; when "0101"=> stop5button<='1'; when "0110"=> stop6button<='1'; when "0111"=> stop7button<='1'; when "1000"=> stop8button<='1'; when others => null; end case; else f1upbutton<='0';f2upbutton<='0

47、'; f2dnbutton<='0'; f3dnbutton<='0'; f3upbutton<='0'; f4dnbutton<='0'; f4upbutton<='0'; f5dnbutton<='0'; f5upbutton<='0'; f6dnbutton<='0'; f6upbutton<='0'; f7dnbutton<='0'; f7upbutton<='0'; f8dnbutton<='0'; stop1button<='0';stop2button<='0'; stop3button<='0';stop4button<='0'; stop5b

48、utton<='0';stop6button<='0'; stop7button<='0';stop8button<='0'; end if; end if; end if; end process ; process(reset,buttonclk) begin if reset='1' then stoplight<="00000000"; fuplight<="00000000"; fdnlight<="00000000"; else if buttonclk'event and buttonclk='1' then if clearup='1' then

49、stoplight(position)<='0'; fuplight(position)<='0'; else if f1upbutton='1' then fuplight(1)<='1'; elsif f2upbutton='1' then fuplight(2)<='1'; elsif f3upbutton='1' then fuplight(3)<='1'; elsif f4upbutton='1' then fuplight(4)<='1'; elsif f5upbutton='1' then fuplight(5)<='1'; elsif f6upbutton='1'

50、 then fuplight(6)<='1'; elsif f7upbutton='1' then fuplight(7)<='1'; end if; end if; if cleardn='1' then stoplight(position)<='0'; fdnlight(position)<='0'; else if f2dnbutton='1' then fdnlight(2)<='1'; elsif f3dnbutton='1' then fdnlight(3)<='1'; elsif f4dnbutton='1' then fdnlight(4)<='1'

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服