資源描述:
《病房呼叫系統(tǒng)報(bào)告》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫(kù)。
1、可編程邏輯器件應(yīng)用項(xiàng)目報(bào)告書項(xiàng)目名稱:病房呼叫系統(tǒng)指導(dǎo)老師:龔蘭芳姓名:曾錦聰學(xué)號(hào):班級(jí):08電子2班目錄一、設(shè)計(jì)要求--------------------------------------------------------------------------------二、設(shè)計(jì)方案--------------------------------------------------------------------------------三、設(shè)計(jì)程序----------------------------------
2、----------------------------------------------四、管腳分配---------------------------------------------------------------------------------五、硬件下載實(shí)現(xiàn)現(xiàn)象描述-----------------------------------------------------------六、體會(huì)與收獲------------------------------------------------------
3、-----------------------一、設(shè)計(jì)要求1.用1~9個(gè)開關(guān)模擬9個(gè)病房的呼叫輸入信號(hào),1號(hào)優(yōu)先級(jí)最高;1~9優(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ì),將功能分為三個(gè)部分,第一部分輸入模塊,用來輸入八個(gè)病房的房號(hào)。第二部分輸出模塊,用來顯示八個(gè)病房的房號(hào)。第三部分顯示模塊,使優(yōu)
4、先級(jí)低的病房房號(hào)用彩燈顯示出來。三、設(shè)計(jì)程序第一部分:搶答模塊libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityjnbisport(clk,i:instd_logic;u,r,t,y:instd_logic;led3:outstd_logic_vector(3downto0);k:outstd_logic_vector(2downto0);o:outstd_logic_
5、vector(3downto0));end;architectureoneofjnbissignaln:integerrange0to1;signalclk_1k,clk_100h:std_logic;signaldata:std_logic_vector(3downto0);signals:std_logic_vector(6downto0);signalh:std_logic_vector(2downto0);signalj:std_logic_vector(3downto0);beginprocess(clk)vari
6、ablecnt1:integerrange0to250;variablecnt2:integerrange0to100;beginifclk'eventandclk='1'thenifcnt1=250thencnt1:=0;ifcnt2=100thencnt2:=0;clk_1k<=notclk_1k;elsecnt2:=cnt2+1;endif;elsecnt1:=cnt1+1;endif;endif;endprocess;process(clk_1k)beginifi='1'thenifn=0thenifu='0'the
7、nled3<="0001";j<="0111";n<=n+1;elsifr='0'thenled3<="0010";j<="1011";n<=n+1;elsift='0'thenled3<="0011";j<="1101";n<=n+1;elsify='0'thenled3<="0100";j<="1110";n<=n+1;endif;endif;elseh<="100";n<=0;led3<="0000";j<="1111";endif;k<=h;o<=j;endprocess;end;第二部分:數(shù)值輸入模塊library
8、ieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;entityWERisport(rst,clk,tsr,en:instd_logic;p:outstd_lo