可编程逻辑器件应用项目报告书-病房呼叫系统报告_第1页
可编程逻辑器件应用项目报告书-病房呼叫系统报告_第2页
可编程逻辑器件应用项目报告书-病房呼叫系统报告_第3页
可编程逻辑器件应用项目报告书-病房呼叫系统报告_第4页
可编程逻辑器件应用项目报告书-病房呼叫系统报告_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

可编程逻辑器件应用项目报告书项目名称:病房呼叫系统指导老师: 姓 名:学 号: 080212216班 级: 08电子2班目录一、设计要求-二、设计方案-三、设计程序-四、管脚分配-五、硬件下载实现现象描述-六、体会与收获- 一、 设计要求1.用19个开关模拟9个病房的呼叫输入信号,1号优先级最高;19优先级依次降低;2.用一个数码管显示呼叫信号的号码;没信号时显示0;有多个信号呼叫时,显示优先级最高的呼叫号(其他呼叫用指示灯显示);3.凡有呼叫发出5秒的呼叫声;4.对低优先级的呼叫进行存储,处理完高优先级的呼叫,再进行低优先级呼叫的处理(附加)。二、设计方案 用层次化的设计,将功能分为三个部分,第一部分输入模块,用来输入八个病房的房号。第二部分输出模块,用来显示八个病房的房号。第三部分显示模块,使优先级低的病房房号用彩灯显示出来。三、设计程序第一部分:抢答模块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_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 0);begin process (clk) variable cnt1:integer range 0 to 250; variable cnt2:integer range 0 to 100; begin if clkevent 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(clk_1k)begin if i=1 then if n=0 then if u=0then 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; 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;第二部分:数值输入模块library ieee;use ieee.std_logic_1164.all;use ieee.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 issignal 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 downto 0);begin process (clk) variable cnt1:integer range 0 to 250; variable cnt2:integer range 0 to 100; begin if clkevent 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 (clk) variable cnt1:integer range 0 to 5000; variable cnt2:integer range 0 to 5000; begin if clkevent 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_1k) begin if clk_1kevent and clk_1k=1 then if cnt6=33 then cnt6=0; else cnt6doutdoutdoutnull; end case;end process;process(dout)begin case dout is when111110=datadatadatanull; end case;end process; process(clk_100h)beginif tsr=0 then led1=0000; led2=0000; t=0;else if rst=0 then t=1; p=0; led2=c;led1=d; elsif clk_100hevent and clk_100h=1 and t=1 then if en=1 then if (led1=0000) then led1=1001; led2=led2-1; if (led2=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 tssssssssssnull; 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=h(5); e=h(4); d=h(3); c=h(2); b=h(1); a=h(0);end o

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论