病房呼叫系統(tǒng)報(bào)告_第1頁(yè)
病房呼叫系統(tǒng)報(bào)告_第2頁(yè)
病房呼叫系統(tǒng)報(bào)告_第3頁(yè)
病房呼叫系統(tǒng)報(bào)告_第4頁(yè)
病房呼叫系統(tǒng)報(bào)告_第5頁(yè)
已閱讀5頁(yè),還剩13頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、.可編程邏輯器件應(yīng)用項(xiàng)目報(bào)告書項(xiàng)目名稱:病房呼叫系統(tǒng)指導(dǎo)老師: 龔蘭芳姓 名: 曾錦聰學(xué) 號(hào): 080212216班 級(jí): 08電子2班目錄一、設(shè)計(jì)要求-二、設(shè)計(jì)方案-三、設(shè)計(jì)程序-四、管腳分配-五、硬件下載實(shí)現(xiàn)現(xiàn)象描述-六、體會(huì)與收獲- 一、 設(shè)計(jì)要求1.用19個(gè)開關(guān)模擬9個(gè)病房的呼叫輸入信號(hào),1號(hào)優(yōu)先級(jí)最高;19優(yōu)先級(jí)依次降低;2.用一個(gè)數(shù)碼管顯示呼叫信號(hào)的號(hào)碼;沒信號(hào)時(shí)顯示0;有多個(gè)信號(hào)呼叫時(shí),顯示優(yōu)先級(jí)最高的呼叫號(hào)(其他呼叫用指示燈顯示);3.凡有呼叫發(fā)出5秒的呼叫聲;4.對(duì)低優(yōu)先級(jí)的呼叫進(jìn)行存儲(chǔ),處理完高優(yōu)先級(jí)的呼叫,再進(jìn)行低優(yōu)先級(jí)呼叫的處理(附加)。二、設(shè)計(jì)方案 用層次化的設(shè)計(jì),將

2、功能分為三個(gè)部分,第一部分輸入模塊,用來輸入八個(gè)病房的房號(hào)。第二部分輸出模塊,用來顯示八個(gè)病房的房號(hào)。第三部分顯示模塊,使優(yōu)先級(jí)低的病房房號(hào)用彩燈顯示出來。三、設(shè)計(jì)程序第一部分:搶答模塊library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity jnb isport(clk,i:in std_logic; u,r,t,y:in std_logic; led3: out std_logic_vector(3 downto 0); k:out

3、 std_logic_vector(2 downto 0); o:out std_logic_vector(3 downto 0);end;architecture one of jnb issignal n:integer range 0 to 1;signal clk_1k,clk_100h:std_logic;signal data:std_logic_vector(3 downto 0);signal s:std_logic_vector(6 downto 0);signal h:std_logic_vector(2 downto 0);signal j:std_logic_vecto

4、r(3 downto 0);begin process (clk) variable cnt1:integer range 0 to 250; variable cnt2:integer range 0 to 100; begin if clk'event and clk='1' then if cnt1=250 then cnt1:=0; if cnt2=100 then cnt2:=0; clk_1k<=not clk_1k; else cnt2:=cnt2+1; end if; else cnt1:=cnt1+1; end if; end if; end p

5、rocess; process(clk_1k)begin if i='1' then if n=0 then if u='0'then led3<="0001" j<="0111" n<=n+1; elsif r='0' then led3<="0010" j<="1011" n<=n+1; elsif t='0' then led3<="0011" j<="1101&quo

6、t; n<=n+1; elsif y='0' then led3<="0100" j<="1110" n<=n+1; end if; end if; else h<="100" n<=0; led3<="0000" j<="1111" end if;k<=h;o<=j;end process;end;第二部分:數(shù)值輸入模塊library ieee;use ieee.std_logic_1164.all;use ieee.

7、std_logic_unsigned.all;use ieee.std_logic_arith.all;entity WER isport(rst,clk,tsr,en:in std_logic; p:out std_logic; c,d:in std_logic_vector(3 downto 0); duon:out std_logic_vector(5 downto 0); led3:in std_logic_vector(3 downto 0); cout:out std_logic_vector(6 downto 0);end;architecture one of WER issi

8、gnal t,r:integer range 0 to 1;signal w:integer range 0 to 6;signal clk_1k:std_logic;signal clk_100h:std_logic;signal cnt6:integer range 0 to 3;signal data:std_logic_vector(3 downto 0);signal dout:std_logic_vector(5 downto 0);signal s:std_logic_vector(6 downto 0);signal led1,led2:std_logic_vector(3 d

9、ownto 0);begin process (clk) variable cnt1:integer range 0 to 250; variable cnt2:integer range 0 to 100; begin if clk'event and clk='1' then if cnt1=250 then cnt1:=0; if cnt2=100 then cnt2:=0; clk_1k<=not clk_1k; else cnt2:=cnt2+1; end if; else cnt1:=cnt1+1; end if; end if; end proces

10、s; process (clk) variable cnt1:integer range 0 to 5000; variable cnt2:integer range 0 to 5000; begin if clk'event and clk='1' then if cnt1=5000 then cnt1:=0; if cnt2=5000 then cnt2:=0; clk_100h<=not clk_100h; else cnt2:=cnt2+1; end if; else cnt1:=cnt1+1; end if; end if; end process; p

11、rocess(clk_1k) begin if clk_1k'event and clk_1k='1' then if cnt6=33 then cnt6<=0; else cnt6<=cnt6+1; end if; end if;end process;process(cnt6)begin case cnt6 is when 0=>dout<="111110" when 1=>dout<="111101" when 2=>dout<="111011" when

12、others=>null; end case;end process;process(dout)begin case dout is when"111110"=>data<=led1; when"111101"=>data<=led2; when"111011"=>data<=led3; when others=>null; end case;end process; process(clk_100h)beginif tsr='0' then led1<="

13、;0000" led2<="0000" t<=0;else if rst='0' then t<=1; p<='0' led2<=c;led1<=d; elsif clk_100h'event and clk_100h='1' and t=1 then if en='1' then if (led1<="0000") then led1<="1001" led2<=led2-1; if (led2&l

14、t;="0000") then led1<="0000" led2<="0000" if w<=5 then p<='1' w<=w+1; else p<='0' end if; else p<='0' end if; else led1<=led1-1; end if; else t<=t-1; end if; end if;end if;end process;process(data)begin case data is whe

15、n"0000"=>s<="0111111"-0 when"0001"=>s<="0000110"-1 when"0010"=>s<="1011011"-2 when"0011"=>s<="1001111"-3 when"0100"=>s<="1100110"-4 when"0101"=>s<="1

16、101101"-5 when"0110"=>s<="1111101"-6 when"0111"=>s<="0000111"-7 when"1000"=>s<="1111111"-8 when"1001"=>s<="1101111"-9 when others=>null; end case;end process;duon<=dout;cout<=s;end;第三部分:譯碼模塊library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity yima isport( h:in std_logic_vector(6 downto 0); a,b,c,d,e,f,g:out std_logic);end;architecture one of yima isbegin g<=h(6); f

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論