数字逻辑课程设计报告书.docVIP

  • 14
  • 0
  • 约7.93千字
  • 约 14页
  • 2019-03-02 发布于安徽
  • 举报
..... word格式.整理版 武汉科技学院计算机科学学院 逻辑设计 课程设计报告 班 级:计科098 学 号:0904681404 姓 名:许双双 同 组 者: 日 期:2011-6-27 1 题目与要求 问题提出(左对齐,宋体粗小四号) 数字钟的设计 1、秒、分为00~59六十进制计数器。 2、时为00~23二十四进制计数器。 3、整点报时。 数码管显示。 5、其它功能(如:星期计数等) 1.2 设计原理 通过程序编程和仿真及下载,而使功能得以实现。它由石英晶体振荡器、分频器、计数器、译码器显示器和校时电路组成。振荡器产生稳定的高频脉冲信号,作为数字钟的时间基准,然后经过分频器输出标准秒脉冲。秒计数器满60后向分计数器进位,分计数器满60后向小时计数器进位,小时计数器按照“24翻1”规律计数。计数器的输出分别经译码器送显示器显示。计时出现误差时,可以用校时电路校时、校分。 2 设计过程 2.1 逻辑描述 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity clock is port(clk,switch,clear,add:in std_logic; set :in std_logic_vector(1 downto 0); second0,second1,minute0,minute1,hour0,hour1:out std_logic_vector(3 downto 0)); end; architecture arch of clock is signal clk0,clr,m0,m1,m2,m3,m4:std_logic; signal cout0:std_logic_vector(3 downto 0); signal cout1:std_logic_vector(3 downto 0); signal cout2:std_logic_vector(3 downto 0); signal cout3:std_logic_vector(3 downto 0); signal cout4:std_logic_vector(3 downto 0); signal cout5:std_logic_vector(3 downto 0); begin start:process(switch) begin if(switch=0)then clk0=clk; else if(add=1)then clk0=1; else clk0=0; end if; end if; end process start; p1:process(clr,clk0) begin if(set=00 or set=01)then if(clr=1)then cout0=0000;m0=0; elsif( rising_edge (clk0)) then if(cout0=1001) then cout0=0000;m0=1; else cout0=cout0+1;m0=0; end if; end if; end if; end process p1; p2:process(clr,m0) begin if(set=00 or set=01)then if(clr=1) then cout1=0000;m1=0; elsif( rising_edge (m0)) then if(cout1=0101) then cout1=0000;m1=1; else cout1=cout1+1;m1=0; end if; end if; elsif(set=10)then if(clk0=1)then m1=1; else m1=0; end if; end if; end process p2; p3:process(clr,m1) begin if(set=00 or set=10)then if(clr=1) then cout2=0000;m2=0; elsif(rising_edge (m1)) then if(cout2=1001) then cout2=0000;m2=1; else cout2=cout2+

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档