- 17
- 0
- 约1.35万字
- 约 17页
- 2016-12-14 发布于贵州
- 举报
可编程逻辑器件应用
项
目
报
告
书
项目名称:病房呼叫系统
指导老师: 龚兰芳
姓 名: 曾锦聪
学 号: 080212216
班 级: 08电子2班
目录
一、设计要求--------------------------------------------------------------------------------
二、设计方案--------------------------------------------------------------------------------
三、设计程序--------------------------------------------------------------------------------
四、管脚分配---------------------------------------------------------------------------------
五、硬件下载实现现象描述-----------------------------------------------------------
六、体会与收获-----------------------------------------------------------------------------
一、 设计要求
1.用1~9个开关模拟9个病房的呼叫输入信号,1号优先级最高;1~9优先级依次降低;
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 is
port(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 is
signal 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 p
原创力文档

文档评论(0)