基于FPGA的六层电梯控制系统课程设计打印终稿(8)

2019-03-05 22:38

基于FPGA 的六层电梯控制系统

end if;

end process controllift;

controllight:process(reset,buttonclk) begin

if reset='1' then stoplight<=\ elsif buttonclk'event and buttonclk='1' then

if clearup='1' then

stoplight(position)<='0';fuplight(position)<='0'; elsif 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';

end if; if cleardn='1' then

stoplight(position)<='0'; fdnlight(position)<='0'; elsif f2dnbutton='1' then fdnlight(2)<='1'; elsif f3dnbutton='1' then fdnlight(3)<='1'; elsif f4dnbutton='1' then fdnlight(4)<='1'; elsif f5dnbutton='1' then fdnlight(5)<='1'; elsif f6dnbutton='1' then fdnlight(6)<='1';

end if; if stop1button='1' then stoplight(1)<='1'; elsif stop2button='1' then stoplight(2)<='1'; elsif stop3button='1' then stoplight(3)<='1'; elsif stop4button='1' then stoplight(4)<='1'; elsif stop5button='1' then stoplight(5)<='1'; elsif stop6button='1' then stoplight(6)<='1';

30

基于FPGA 的六层电梯控制系统

end if; end if;

end process controllight; end art; 分频器程序: library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity div is port(

clk_in:in std_logic; div_out:out std_logic ); end;

architecture a of div is

signal fre_N:integer range 0 to 10; signal clk_tmp:std_logic; begin

div_out<=clk_tmp; process(clk_in) begin

if falling_edge(clk_in) then if fre_N>10 then fre_N<=0;

clk_tmp<=not clk_tmp; else fre_N<=fre_N+1; end if;

31

基于FPGA 的六层电梯控制系统

end if; end process; end a; 译码器程序: library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity yima is port(

aaa:integer range 1 to 6;

bbb:out std_logic_vector(3 downto 0) ); end;

architecture a of yima is begin process(aaa) begin

if aaa=1 then bbb<=\ elsif aaa=2 then bbb<=\ elsif aaa=3 then bbb<=\ elsif aaa=4 then bbb<=\ elsif aaa=5 then bbb<=\ elsif aaa=6 then bbb<=\end if; end process; end a;

数据选择器程序: library ieee;

use ieee.std_logic_1164.all;

32

基于FPGA 的六层电梯控制系统

entity led is port(

input:in std_logic_vector(3 downto 0); output:out std_logic_vector(6 downto 0) ); end;

architecture a of led is begin

process(input)

output<=\ \ \ \ \ \ \end process; end a;

33


基于FPGA的六层电梯控制系统课程设计打印终稿(8).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:时尚买手店合作经营协议

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: