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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 電梯.txt

?? 四層電梯vhdl 1、 每層電梯的入口處設有上下請求開關
?? TXT
字號:
1 樓主:【控制實例】一個VHDL電梯控制器的程序 
貼子發表于:2008-6-16 20:19:55


1、  每層電梯的入口處設有上下請求開關,電梯內設有乘客到達層次的停站請求開關。


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


3、  電梯每秒升降一層。


4、  電梯到達有停站請求的樓層后,經過1s電梯打開,開門只是燈亮,開門4s后,電梯門關閉(關門指示燈滅),電梯繼續運行,直至執行完請求信號后停在當前樓層。


5、  能記憶電梯內外的所以請求信號,并按照電梯運行規則依次響應,每個請求信號保留至執行后消除。


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


7、  電梯初始狀態為一層門開。


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; --提前關門鍵
delay: in STD_LOGIC; --延時關門鍵
run_stop: in STD_LOGIC; --電梯運行開關
lamp: out STD_LOGIC; --運行或停止燈
run_waitdis: out STD_LOGIC_VECTOR (6 downto 0); --運行或等待時間
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; --提前關門鍵
delay: in STD_LOGIC; --延時關門鍵
run_stop: in STD_LOGIC; --電梯運行開關
lamp: out STD_LOGIC; --運行或停止燈
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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品美女一区二区三区| 亚洲一区二区三区四区不卡| 亚洲精品乱码久久久久久久久| 日韩高清在线不卡| 一本到三区不卡视频| 欧美成人三级在线| 午夜激情一区二区三区| 色哟哟亚洲精品| 中文一区二区完整视频在线观看| 免费观看久久久4p| 欧美日韩视频专区在线播放| 最新久久zyz资源站| 国产精品77777| 精品国产露脸精彩对白| 视频在线在亚洲| 欧美性做爰猛烈叫床潮| 伊人一区二区三区| 91丝袜国产在线播放| 国产精品久久久久aaaa| 国产在线播放一区二区三区| 2014亚洲片线观看视频免费| 日本麻豆一区二区三区视频| 欧美麻豆精品久久久久久| 一区二区三区丝袜| 91官网在线免费观看| 亚洲品质自拍视频| 99精品桃花视频在线观看| 国产精品三级av| 国产成人免费视频 | 欧美私人免费视频| 亚洲主播在线播放| 欧美亚洲国产怡红院影院| 日韩理论片在线| 色综合天天综合狠狠| 亚洲乱码国产乱码精品精可以看| 95精品视频在线| 亚洲精品日日夜夜| 欧美日韩一级片在线观看| 亚洲国产cao| 制服丝袜亚洲网站| 精一区二区三区| 久久九九国产精品| 色综合久久久久综合体| 亚洲国产你懂的| 91精品国产综合久久香蕉麻豆| 麻豆精品视频在线观看免费| 精品久久久三级丝袜| 国产精品18久久久久久vr | 精品av久久707| 国产福利不卡视频| 亚洲图片欧美激情| 欧美精品日韩综合在线| 激情综合色综合久久| 国产精品久久三| 欧美影院午夜播放| 国内精品在线播放| 亚洲欧洲综合另类| 欧美zozo另类异族| 99在线精品一区二区三区| 亚洲国产精品视频| 久久久久久影视| 日本高清不卡一区| 黄色资源网久久资源365| 中文字幕一区二区三区在线不卡| 欧美欧美欧美欧美首页| 成人动漫一区二区在线| 五月天亚洲精品| 久久精品夜夜夜夜久久| 精品视频在线免费| 国产精品系列在线播放| 亚洲午夜久久久久久久久电影网| 欧美xxxxx牲另类人与| 91理论电影在线观看| 免费观看一级欧美片| 亚洲九九爱视频| 337p日本欧洲亚洲大胆精品| 色视频一区二区| 国产suv精品一区二区三区 | 亚洲国产成人精品视频| 久久久综合九色合综国产精品| 欧美影院午夜播放| 波多野结衣中文字幕一区| 麻豆91精品视频| 亚洲国产成人91porn| 亚洲视频 欧洲视频| 久久亚洲二区三区| 91精品国产综合久久福利 | 精品国产三级a在线观看| 91黄视频在线| 成人黄色片在线观看| 国内精品伊人久久久久av影院| 日韩中文字幕区一区有砖一区| 成人免费一区二区三区视频| 国产亚洲一本大道中文在线| 日韩午夜激情免费电影| 欧美日韩黄视频| 欧美视频一二三区| 日本道在线观看一区二区| 成熟亚洲日本毛茸茸凸凹| 国产乱码字幕精品高清av| 麻豆精品在线观看| 日本亚洲天堂网| 日本不卡一二三| 日欧美一区二区| 视频在线观看91| 午夜电影网亚洲视频| 亚洲国产成人va在线观看天堂| 亚洲综合丝袜美腿| 亚洲国产裸拍裸体视频在线观看乱了 | 国产老女人精品毛片久久| 美腿丝袜亚洲色图| 免费一级片91| 久草精品在线观看| 国产一区二区女| 国产成a人无v码亚洲福利| 国产成人福利片| 成人ar影院免费观看视频| 9l国产精品久久久久麻豆| 色香蕉成人二区免费| 色一区在线观看| 欧美日韩激情一区二区三区| 欧美一区二区三区在线观看视频| 69久久夜色精品国产69蝌蚪网| 91精品国产品国语在线不卡| 欧美大度的电影原声| 久久精品视频在线免费观看 | 97se亚洲国产综合自在线不卡| av亚洲精华国产精华精| 91高清视频在线| 蜜桃久久av一区| 2欧美一区二区三区在线观看视频| 欧美一区二区三区在线电影| 精品国产乱码久久久久久夜甘婷婷 | 偷拍与自拍一区| 久久超级碰视频| www.欧美亚洲| 欧美日韩一区精品| ww亚洲ww在线观看国产| 国产精品毛片大码女人| 亚洲成av人影院| 精东粉嫩av免费一区二区三区| 国产成人精品免费看| 欧美日韩三级一区| 久久久国产午夜精品 | 国产精品视频第一区| 亚洲精品乱码久久久久| 免费欧美高清视频| 成人晚上爱看视频| 欧美精品丝袜久久久中文字幕| 国产亚洲一区二区三区在线观看| 亚洲精品欧美激情| 久久99久久久欧美国产| 中文字幕av不卡| 一区二区三区免费网站| 日本视频一区二区| 波波电影院一区二区三区| 欧美三级韩国三级日本三斤| 久久麻豆一区二区| 亚洲一区二区三区在线看| 激情综合五月婷婷| 欧美性猛交xxxxxxxx| 精品国产不卡一区二区三区| 亚洲国产日韩精品| 成人av免费在线播放| 日韩一区二区在线观看视频| 亚洲欧美激情插| 久久成人综合网| 欧美日韩在线一区二区| 国产精品久久久久四虎| 国产一区久久久| 在线电影欧美成精品| 亚洲精品成a人| 国产91丝袜在线播放| 欧美一三区三区四区免费在线看| 亚洲天堂久久久久久久| 偷拍与自拍一区| 色综合色狠狠综合色| 亚洲最快最全在线视频| 成人高清免费观看| 久久久国产精品麻豆| 日本强好片久久久久久aaa| 日本精品视频一区二区| 国产精品三级电影| 成人免费高清视频| 久久久精品国产免费观看同学| 美女被吸乳得到大胸91| 9191精品国产综合久久久久久| 一区二区三区精密机械公司| 91网页版在线| 亚洲色欲色欲www| 91理论电影在线观看| 综合精品久久久| www.性欧美| 综合激情成人伊人| 91丨porny丨在线| 中文字幕人成不卡一区| 不卡av电影在线播放| 综合在线观看色| 一本色道久久综合亚洲aⅴ蜜桃 | 久久蜜桃香蕉精品一区二区三区|