文档详情

数字逻辑课程设计--多功能数字钟设计实验报告.doc

发布:2018-05-11约4.48万字共15页下载文档
文本预览下载声明
课 程 设 计 报 告 课程:数字逻辑与数字系统 课题:多 功 能 数 字 电 子 钟 姓名: 学号: 学院: 班级: 指导老师: 设计日期: 设计要求 具有以二十四小时制计时、显示、整点报时、时间设置公能。 精度要求为1s。 系统功能简介 计时:正常工作状态下每天按24小时制计时并显示,蜂鸣器无声,逢整点报时。 整点报时:蜂鸣器在59分钟的51、53、55、57、59秒时发出频率为512hz的低音,在59秒时发出1024hz的高音,结束时为整点。 显示:要求采用扫描显示方式驱动8个LED数码管显示小时、分、秒、横线。 调时和校时:当开关处于“k1”、“k2”处于“1”时正常计时,当k1处于“0”位置时可以对小时校时,当k2处于“0”位置时可以对分钟进行校时。另外对六十进制计数器加了一个清零端,可以进行秒的复位。 系统简介 开发系统:windows xp/98 开发软件:MAX+PIUS II 开发芯片:EP1K10TC100—3 主要模块简介 此系统由计时调时模块、闹钟模块、定时模块、动显模块和分频模块组成。 数字钟系统总体结构框图: 1 分频器: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity fenpin is port (clk :in std_logic; f1024,f512,f4,f1 :out std_logic); end fenpin ; architecture behav of fenpin is signal q:std_logic_vector(9 downto 0); begin process(clk,q) begin if(clkevent and clk=1)then if(q=1111111111)then q=0000000000; else q=q+1; end if ; end if ; f1024=clk; f512=q(0); f4=q(7); f1=q(9); end process; end behav; 2 二选一数据选择器 library ieee; use ieee.std_logic_1164.all; entity mux2_1 is port(d0,d1,sel:in std_logic; q :out std_logic); end mux2_1; architecture amux of mux2_1 is signal temp1,temp2,temp3 :std_logic; begin cale:block begin temp1=d0 and sel;--1正常计时 temp2=d1 and (not sel);--0调时 temp3=temp1 or temp2; q=temp3; end block cale; end amux; 3 24进制计数器: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity mo24 is port (clk:in std_logic; qh,ql:out std_logic_vector(3 downto 0) ); end mo24; architecture wc of mo24 is signal qhh,qll:std_logic_vector(3 downto 0); begin process(clk) begin if(clkevent and clk=1) then if(qll=0010 and qhh=0011)then qhh=0000; qll=0000; elsif(qhh=1001)then qll=qll+1; qhh=0000; else qhh=qhh+1;end if; end if; qh=qhh; ql=qll; end process; end wc; 60进制计数器: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity m60 is port (clk,clr:in std_logic; qh,ql:out std_logic_vector(3 downto 0); co:out std_logic
显示全部
相似文档