




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、可編程邏輯器件應(yīng)用項目報告書項目名稱:病房呼叫系統(tǒng)指導(dǎo)老師:龔蘭芳姓名:曾錦聰學(xué)號:080212216班級:08電子2班目錄一、設(shè)計要求-二、設(shè)計方案-三、設(shè)計程序-四、管腳分配-五、硬件下載實現(xiàn)現(xiàn)象描述-六、體會與收獲-一、設(shè)計要求1.用19個開關(guān)模擬9個病房的呼叫輸入信號,1號優(yōu)先級最高;19優(yōu)先級依次降低;2.用一個數(shù)碼管顯示呼叫信號的號碼;沒信號時顯示0;有多個信號呼叫時,顯示優(yōu)先級最高的呼叫號(其他呼叫用指示燈顯示);3.凡有呼叫發(fā)出5秒的呼叫聲;4.對低優(yōu)先級的呼叫進(jìn)行存儲,處理完高優(yōu)先級的呼叫,再進(jìn)行低優(yōu)先級呼叫的處理(附加)。二、設(shè)計方案用層次化的設(shè)計,將功能分為三個部分,第一
2、部分輸入模塊,用來輸入八個病房的房號。第二部分輸出模塊,用來顯示八個病房的房號。第三部分顯示模塊,使優(yōu)先級低的病房房號用彩燈顯示出來。三、設(shè)計程序第一部分:搶答模塊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 std_logic_
3、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_vector(3 downto
4、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 process;proc
5、ess(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" n<=n+1
6、; 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.std_logic_un
7、signed.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 issignal t,r:int
8、eger 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 downto 0);beg
9、in 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 process; process (
10、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; process(clk_1
11、k) 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 others=>n
12、ull; 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<="0000" l
13、ed2<="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<="0000
14、") 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 when"0000&q
15、uot;=>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<="1101101"-
16、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);
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 教育教學(xué)改革課題申報書
- 合作開洗車店合同范本
- 農(nóng)村購買門面合同范本
- 廠房建筑加固工程合同范本
- 書法育人課題申報書
- 廠房建設(shè)各類合同范本
- 中價出租合同范例
- 雙向投資合同范本
- 友寶采購合同范本
- 合租商鋪合同范本簡易
- 《紅巖》中考試題(截至2024年)
- 2025年合肥職業(yè)技術(shù)學(xué)院單招職業(yè)適應(yīng)性測試題庫完整版
- 2025年全國幼兒園教師資格證考試教育理論知識押題試題庫及答案(共九套)
- 人教版(2024)六年級全一冊 第16課 智能種植初探秘
- 新能源發(fā)電技術(shù) 課件 第一章-新能源發(fā)電概述
- 中醫(yī)醫(yī)療技術(shù)手冊2013普及版
- 中考數(shù)學(xué)第二輪復(fù)習(xí)教案
- 鈑金k因子和折彎扣除參照表
- 海圖圖標(biāo)說明(共13頁)
- 首都機(jī)場集團(tuán)公司固定資產(chǎn)實物分類指導(dǎo)規(guī)則20140901(終稿)
- 釩電池項目財務(wù)數(shù)據(jù)分析(范文模板)
評論
0/150
提交評論