亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 電梯.txt

?? 一個VHDL電梯控制器的程序 1、 每層電梯的入口處設(shè)有上下請求開關(guān)
?? TXT
字號:
一個VHDL電梯控制器的程序 
  
1、  每層電梯的入口處設(shè)有上下請求開關(guān),電梯內(nèi)設(shè)有乘客到達(dá)層次的停站請求開關(guān)。


2、  設(shè)有電梯所處位置指示裝置及電梯運(yùn)行模式(上升或下降)指示裝置。


3、  電梯每秒升降一層。


4、  電梯到達(dá)有停站請求的樓層后,經(jīng)過1s電梯打開,開門只是燈亮,開門4s后,電梯門關(guān)閉(關(guān)門指示燈滅),電梯繼續(xù)運(yùn)行,直至執(zhí)行完請求信號后停在當(dāng)前樓層。


5、  能記憶電梯內(nèi)外的所以請求信號,并按照電梯運(yùn)行規(guī)則依次響應(yīng),每個請求信號保留至執(zhí)行后消除。


6、  電梯運(yùn)行規(guī)則:當(dāng)電梯處于上升模式時,只響應(yīng)比電梯所在位置高的上樓信號,由下至上依次執(zhí)行,直到最后一個上樓請求執(zhí)行完畢,如更高層有下樓請求時,則直接升到有下降請求的最高樓接客,然后進(jìn)入下降模式,但電梯處于下降模式時,則與上升模式相反。


7、  電梯初始狀態(tài)為一層門開。


library ieee; 
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

 


entity led1 is
port(ledin:in std_logic_vector(3 downto 0);
ledout:out std_logic_vector(6 downto 0));
end led1;

 

architecture a_led of led1 is
begin
process(ledin)
begin 
case ledin is --The sequence is "g f e d c b a"
when "0000" => ledout<="0111111"; -- " show 0 "
when "0001" => ledout<="0000110"; -- " show 1 "
when "0010" => ledout<="1011011"; -- " show 2 "
when "0011" => ledout<="1001111"; -- " show 3 "
when "0100" => ledout<="1100110"; -- " show 4 "
when "0101" => ledout<="1101101"; -- " show 5 "
when "0110" => ledout<="1111101"; -- " show 6 "
when "0111" => ledout<="0000111"; -- " show 7 "
when "1000" => ledout<="1111111"; -- " show 8 "
when "1001" => ledout<="1101111"; -- " show 9 "
when "1010" => ledout<="1110111"; -- " show 10 "
when "1011" => ledout<="1111100"; -- " show 11 "
when "1100" => ledout<="0111001"; -- " show 12 "
when "1101" => ledout<="1011110"; -- " show 13 " 
when "1110" => ledout<="1111001"; -- " show 14 "
when "1111" => ledout<="1110001"; -- " show 15 "
when others => ledout<="XXXXXXX"; --必須有,Here it is 'X',single quote
end case;
end process ;
end a_led;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;

 

entity lift1 is
port (
clk: in STD_LOGIC; --2hz信號
upin: in STD_LOGIC; --上升請求鍵
downin: in STD_LOGIC; --下降請求鍵
st_ch: in STD_LOGIC; --樓層選擇鍵
close: in STD_LOGIC; --提前關(guān)門鍵
delay: in STD_LOGIC; --延時關(guān)門鍵
run_stop: in STD_LOGIC; --電梯運(yùn)行開關(guān)
lamp: out STD_LOGIC; --運(yùn)行或停止燈
run_waitdis: out STD_LOGIC_VECTOR (6 downto 0); --運(yùn)行或等待時間
st_outdis: out STD_LOGIC_VECTOR (6 downto 0); --電梯所在樓層指示
directdis: out STD_LOGIC_VECTOR (6 downto 0) --樓層選擇指示
);
end lift1;

 

architecture lift1_arch of lift1 is
component led1
port(ledin:in std_logic_vector(3 downto 0);
ledout:out std_logic_vector(6 downto 0));
end component;

 

signal ur,dr:STD_LOGIC_VECTOR (6 downto 1);
signal dir,liftor:integer range 0 to 5;
signal wai_t:STD_LOGIC_VECTOR (2 downto 0);
signal divide,hand,clkin:STD_LOGIC;
signal ladd:STD_LOGIC_VECTOR (1 downto 0);
signal closex,delayx:STD_LOGIC;
signal run_wait: STD_LOGIC_VECTOR (3 downto 0);
signal st_out: STD_LOGIC_VECTOR (3 downto 0);
signal direct: STD_LOGIC_VECTOR (3 downto 0);

 

begin
direct<='0'&conv_std_logic_vector(dir,3)+1;
st_out<='0'&conv_std_logic_vector(liftor,3)+1;
run_wait<='0'&wai_t;
lamp<=ladd(1);
hand<=wai_t(2) and (not wai_t(1)) and wai_t(0);
closex<=close and (not ladd(1));
delayx<=delay and (not ladd(1));

 

urun_wait:led1 port map(run_wait,run_waitdis);
ust_out:led1 port map(st_out,st_outdis);
udirect:led1 port map(direct,directdis);

 

p0:process(clk)
begin
if (clk'event and clk='1') then
clkin<=not clkin;
end if;
end process p0;

 

p1:process(clkin)
begin
if (clkin'event and clkin='1') then
divide<=not divide;
if (dir=5) then
dir<=0;
else
dir<=dir+1;
end if;
end if;
end process p1;

 

p2:process(ur,dr,dir,upin,downin,st_ch,liftor,wai_t,run_stop,hand)
variable num,t:integer range 0 to 6;
begin
num:=liftor+1;
t:=dir+1;
if (run_stop='1') then
if (((t>num) and (st_ch='1')) or (upin='1')) then
case t is
when 1 => ur(1)<='1';
when 2 => ur(2)<='1';
when 3 => ur(3)<='1';
when 4 => ur(4)<='1';
when 5 => ur(5)<='1';
when 6 => ur(6)<='1';
when others =>Null;
end case;
elsif (hand='1') then 
case num is
when 1 => ur(1)<='0';
when 2 => ur(2)<='0';
when 3 => ur(3)<='0';
when 4 => ur(4)<='0';
when 5 => ur(5)<='0';
when 6 => ur(6)<='0';
when others =>Null;
end case;
end if;
if (((t<num) and (st_ch='1')) or (downin='1')) then
case t is
when 1 => dr(1)<='1';
when 2 => dr(2)<='1';
when 3 => dr(3)<='1';
when 4 => dr(4)<='1';
when 5 => dr(5)<='1';
when 6 => dr(6)<='1';
when others =>Null;
end case;
elsif (hand='1') then
case num is
when 1 => dr(1)<='0';
when 2 => dr(2)<='0';
when 3 => dr(3)<='0';
when 4 => dr(4)<='0';
when 5 => dr(5)<='0';
when 6 => dr(6)<='0';
when others =>Null;
end case;
end if;
else
ur<="000000";
dr<="000000";
end if;
end process p2;

 

p3:process(ur,dr,liftor,ladd,wai_t,run_stop)
begin
if (run_stop='1') then
if (wai_t="110") then
if ((ur or dr)="000000") then
ladd(1)<='0';
else
case liftor is
when 0 =>if ((ur(1) or dr(1))>'0') then
ladd(1)<='0';
else
ladd<="11";
end if;
when 1 =>if ((ur(2) or dr(2))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6 downto 3) or dr(6 downto 3))>"0000")) or((ur(1) or dr(1))='0')) then
ladd<="11";
else
ladd<="10";
end if; 
when 2 =>if ((ur(3) or dr(3))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6 downto 4) or dr(6 downto 4))>"000")) or((ur(2 downto 1) or dr(2 downto 1))="00")) then
ladd<="11";
else
ladd<="10";
end if; 
when 3 =>if ((ur(4) or dr(4))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6 downto 5) or dr(6 downto 5))>"00")) or((ur(3 downto 1) or dr(3 downto 1))="000")) then
ladd<="11";
else
ladd<="10";
end if;
when 4 =>if ((ur(5) or dr(5))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6) or dr(6))>'0')) or((ur(4 downto 1) or dr(4 downto 1))="0000")) then
ladd<="11";
else
ladd<="10";
end if;
when 5 =>if ((ur(6) or dr(6))>'0') then
ladd(1)<='0'; 
else
ladd<="10";
end if;
when others=>null;
end case;
end if;
end if;
else
ladd<="00";
end if;
end process p3;

 

p4:process(divide,wai_t,ladd,closex,delayx)
begin
if (divide'event and divide='1') then
if (wai_t="000" or closex='1') then
wai_t<="110";
else
if (delayx='0') then
wai_t<=wai_t-1;
else
wai_t<="010";
end if;
if (wai_t="001") then
if (ladd="11") then 
liftor<=liftor+1;
elsif (ladd="10") then
liftor<=liftor-1;
end if;
end if;
end if;
end if;
end process p4;
end lift1_arch;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;

 

entity lifter is
port (
clk: in STD_LOGIC; --4mhz信號
upin: in STD_LOGIC; --上升請求鍵
downin: in STD_LOGIC; --下降請求鍵
st_ch: in STD_LOGIC; --樓層選擇鍵
close: in STD_LOGIC; --提前關(guān)門鍵
delay: in STD_LOGIC; --延時關(guān)門鍵
run_stop: in STD_LOGIC; --電梯運(yùn)行開關(guān)
lamp: out STD_LOGIC; --運(yùn)行或停止燈
selout:out STD_LOGIC_VECTOR (2 downto 0);
segout: out STD_LOGIC_VECTOR (6 downto 0) 
);
end lifter;

 

architecture lift1_arch of lifter is
component led1
port(ledin:in std_logic_vector(3 downto 0);
ledout:out std_logic_vector(6 downto 0));
end component;

 

signal ur,dr:STD_LOGIC_VECTOR (6 downto 1);
signal dir,liftor:integer range 0 to 5;
signal wai_t:STD_LOGIC_VECTOR (2 downto 0);
signal div,cp,hand,clkin:STD_LOGIC;
signal ladd,s:STD_LOGIC_VECTOR (1 downto 0);
signal closex,delayx:STD_LOGIC;
signal run_wait: STD_LOGIC_VECTOR (3 downto 0);
signal st_out: STD_LOGIC_VECTOR (3 downto 0);
signal direct: STD_LOGIC_VECTOR (3 downto 0);
signal dout: STD_LOGIC_VECTOR (3 downto 0);
signal q:STD_LOGIC_VECTOR (21 downto 0);

 

begin
direct<='0'&conv_std_logic_vector(dir,3)+1;
st_out<='0'&conv_std_logic_vector(liftor,3)+1;
run_wait<='0'&wai_t;
lamp<=ladd(1);
hand<=wai_t(2) and (not wai_t(1)) and wai_t(0);
closex<=(not close) and (not ladd(1));
delayx<=(not delay) and (not ladd(1));
selout<="001" when s=0 else
"010" when s=1 else
"100" when s=2 else
"000";
dout<=direct when s=0 else
run_wait when s=1 else
st_out when s=2 else
"0000000";

 

u:led1 port map(dout,segout);

 

p0:process(clk)
begin
if (clk'event and clk='1') then
q<=q+1;
end if;
end process p0;
cp<=q(20);
s<=q(14 downto 13);
p1:process(cp)
begin
if (cp'event and cp='1') then
div<=not div;
if (dir=5) then
dir<=0;
else
dir<=dir+1;
end if;
end if;
end process p1;

 

p2:process(ur,dr,dir,upin,downin,st_ch,liftor,wai_t,run_stop,hand)
variable num,t:integer range 0 to 6;
begin
num:=liftor+1;
t:=dir+1;
if (run_stop='1') then
if (((t>num) and (st_ch='0')) or (upin='0')) then
case t is
when 1 => ur(1)<='1';
when 2 => ur(2)<='1';
when 3 => ur(3)<='1';
when 4 => ur(4)<='1';
when 5 => ur(5)<='1';
when 6 => ur(6)<='1';
when others =>Null;
end case;
elsif (hand='1') then 
case num is
when 1 => ur(1)<='0';
when 2 => ur(2)<='0';
when 3 => ur(3)<='0';
when 4 => ur(4)<='0';
when 5 => ur(5)<='0';
when 6 => ur(6)<='0';
when others =>Null;
end case;
end if;
if (((t<num) and (st_ch='0')) or (downin='0')) then
case t is
when 1 => dr(1)<='1';
when 2 => dr(2)<='1';
when 3 => dr(3)<='1';
when 4 => dr(4)<='1';
when 5 => dr(5)<='1';
when 6 => dr(6)<='1';
when others =>Null;
end case;
elsif (hand='1') then
case num is
when 1 => dr(1)<='0';
when 2 => dr(2)<='0';
when 3 => dr(3)<='0';
when 4 => dr(4)<='0';
when 5 => dr(5)<='0';
when 6 => dr(6)<='0';
when others =>Null;
end case;
end if;
else
ur<="000000";
dr<="000000";
end if;
end process p2;

 

p3:process(ur,dr,liftor,ladd,wai_t,run_stop)
begin
if (run_stop='1') then
if (wai_t="110") then
if ((ur or dr)="000000") then
ladd(1)<='0';
else
case liftor is
when 0 =>if ((ur(1) or dr(1))>'0') then
ladd(1)<='0';
else
ladd<="11";
end if;
when 1 =>if ((ur(2) or dr(2))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6 downto 3) or dr(6 downto 3))>"0000")) or((ur(1) or dr(1))='0')) then
ladd<="11";
else
ladd<="10";
end if; 
when 2 =>if ((ur(3) or dr(3))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6 downto 4) or dr(6 downto 4))>"000")) or((ur(2 downto 1) or dr(2 downto 1))="00")) then
ladd<="11";
else
ladd<="10";
end if; 
when 3 =>if ((ur(4) or dr(4))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6 downto 5) or dr(6 downto 5))>"00")) or((ur(3 downto 1) or dr(3 downto 1))="000")) then
ladd<="11";
else
ladd<="10";
end if;
when 4 =>if ((ur(5) or dr(5))>'0') then
ladd(1)<='0';
elsif(((ladd(0)='1') and ((ur(6) or dr(6))>'0')) or((ur(4 downto 1) or dr(4 downto 1))="0000")) then
ladd<="11";
else
ladd<="10";
end if;
when 5 =>if ((ur(6) or dr(6))>'0') then
ladd(1)<='0'; 
else
ladd<="10";
end if;
when others=>null;
end case;
end if;
end if;
else
ladd<="00";
end if;
end process p3;

 

p4:process(div,wai_t,ladd,closex,delayx)
begin
if (div'event and div='1') then
if (wai_t="000" or closex='1') then
wai_t<="110";
else
if (delayx='0') then
wai_t<=wai_t-1;
else
wai_t<="010";
end if;
if (wai_t="001") then
if (ladd="11") then 
liftor<=liftor+1;
elsif (ladd="10") then
liftor<=liftor-1;
end if;
end if;
end if;
end if;
end process p4;
end lift1_arch;
 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美视频在线观看| 亚洲乱码中文字幕综合| 欧美午夜宅男影院| 欧美中文字幕一区二区三区| 一区二区高清视频在线观看| 欧美午夜精品免费| 美女www一区二区| 自拍偷拍国产精品| 波波电影院一区二区三区| 精品少妇一区二区三区视频免付费 | 韩国v欧美v日本v亚洲v| 一区二区三区免费在线观看| 国产精品福利在线播放| 2023国产精品自拍| 日韩欧美自拍偷拍| 91精品国产入口在线| 欧美中文字幕一区| 97久久超碰国产精品电影| 成人在线综合网站| 国产一区美女在线| 国产中文字幕一区| 久久av资源网| 老司机午夜精品| 久久精品国产久精国产| 蜜乳av一区二区三区| 日日骚欧美日韩| 天堂一区二区在线| 日本伊人精品一区二区三区观看方式| 一区二区三区国产精华| 亚洲免费三区一区二区| 亚洲欧美经典视频| 亚洲男同性恋视频| 亚洲激情男女视频| 亚洲一区二区视频在线观看| 亚洲精品成人精品456| 夜夜夜精品看看| 亚洲一区二区欧美日韩| 亚洲国产视频一区二区| 亚洲国产一区二区在线播放| 亚洲不卡一区二区三区| 性感美女久久精品| 欧美aⅴ一区二区三区视频| 免费人成在线不卡| 国产一区二区网址| 成人国产精品免费网站| av激情综合网| 欧美色老头old∨ideo| 欧美日韩三级一区二区| 欧美精品1区2区3区| 日韩欧美一区二区视频| 2欧美一区二区三区在线观看视频| 久久色在线视频| 欧美国产丝袜视频| 亚洲欧美日韩成人高清在线一区| 亚洲综合在线视频| 日韩激情一二三区| 国产精品亚洲专一区二区三区| 成人午夜精品在线| 欧美亚日韩国产aⅴ精品中极品| 欧美精品日韩一区| 久久久久久久久久久久电影| 中文字幕中文字幕在线一区| 亚洲mv在线观看| 精品一区二区三区视频在线观看| 国产成人在线视频免费播放| 91麻豆免费在线观看| 9191精品国产综合久久久久久| 日韩无一区二区| 国产精品福利一区二区三区| 亚洲bt欧美bt精品| 国产精华液一区二区三区| 色婷婷综合久久久久中文 | 欧美成人精品二区三区99精品| 国产午夜精品理论片a级大结局 | 日韩成人伦理电影在线观看| 国产大陆精品国产| 欧美日韩专区在线| 国产视频视频一区| 亚洲一区二区三区美女| 国产精品一级在线| 欧美日韩亚洲不卡| 中文字幕 久热精品 视频在线| 天天综合色天天综合| 成人午夜在线播放| 欧美一区二区久久久| 亚洲日本va午夜在线影院| 蜜桃av一区二区| 91福利在线免费观看| 国产亚洲一区二区在线观看| 亚洲一区影音先锋| 国产99久久精品| 欧美丰满少妇xxxbbb| 中文字幕一区在线| 国内精品伊人久久久久av一坑| 欧美伊人久久大香线蕉综合69| 久久久精品天堂| 日本不卡123| 欧美天堂一区二区三区| 国产精品美女久久久久高潮 | 色女孩综合影院| 久久久久久久综合| 美女视频一区二区| 91免费观看国产| 中文字幕精品一区二区三区精品| 麻豆国产精品官网| 欧美精品日日鲁夜夜添| 亚洲精品中文在线| 成人av综合一区| 久久综合给合久久狠狠狠97色69| 日产精品久久久久久久性色| 在线观看一区二区精品视频| 中文字幕亚洲一区二区va在线| 国产在线播精品第三| 欧美大黄免费观看| 日韩成人一区二区三区在线观看| 在线视频国内自拍亚洲视频| 亚洲少妇30p| av不卡在线播放| 国产精品久久久久久亚洲毛片 | 亚洲一区二区中文在线| 99视频精品全部免费在线| 国产丝袜美腿一区二区三区| 久久精品二区亚洲w码| 日韩视频免费观看高清完整版在线观看 | 久久先锋影音av鲁色资源网| 青青草伊人久久| 日韩一区二区在线观看视频播放| 五月综合激情日本mⅴ| 欧美日韩高清一区二区不卡| 亚洲一区二区精品久久av| 色8久久精品久久久久久蜜| 亚洲麻豆国产自偷在线| 色丁香久综合在线久综合在线观看| 国产精品激情偷乱一区二区∴| 成人sese在线| 亚洲欧美日韩国产手机在线| 一本大道av伊人久久综合| 一区二区免费看| 欧美情侣在线播放| 免费高清在线视频一区·| 欧美草草影院在线视频| 国产美女av一区二区三区| 久久婷婷国产综合精品青草| 国产传媒欧美日韩成人| 国产精品毛片无遮挡高清| 9人人澡人人爽人人精品| 亚洲精品国产一区二区三区四区在线| 91福利社在线观看| 日本欧美在线观看| 国产亚洲欧美在线| 91麻豆精东视频| 日韩在线播放一区二区| 精品久久久久久久久久久院品网| 国产一区激情在线| 亚洲天堂免费看| 91精品在线观看入口| 国精产品一区一区三区mba桃花| 国产清纯在线一区二区www| 99精品视频一区二区| 亚洲一区二区av在线| 91精品麻豆日日躁夜夜躁| 国产乱人伦偷精品视频免下载| 亚洲私人影院在线观看| 欧美二区在线观看| 国产激情一区二区三区| 伊人色综合久久天天| 欧美大度的电影原声| 91网站最新地址| 美女精品自拍一二三四| 中文字幕在线一区免费| 7777女厕盗摄久久久| 国产福利一区二区三区视频 | 亚洲精品视频在线观看网站| 欧美高清视频一二三区| 国产精品小仙女| 亚洲第一成人在线| 欧美国产1区2区| 7777精品伊人久久久大香线蕉的 | 精品久久久影院| 色呦呦一区二区三区| 久久99国产精品麻豆| 樱花草国产18久久久久| 久久久精品日韩欧美| 欧美色电影在线| 丁香一区二区三区| 日本视频一区二区| 亚洲色图19p| 久久久久久久网| 欧美一区二区三区视频在线观看| 波多野结衣亚洲| 久久精品国产77777蜜臀| 亚洲图片一区二区| 亚洲欧洲日韩在线| 国产日韩三级在线| 日韩欧美一级在线播放| 欧美亚洲禁片免费| 色丁香久综合在线久综合在线观看| 国产毛片精品视频| 视频一区二区中文字幕| 一个色妞综合视频在线观看|