欢迎来到天天文库
浏览记录
ID:18971203
大小:335.50 KB
页数:10页
时间:2018-09-27
《数字系统设计实践课程设计报告(数字钟)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、评分:________数字系统设计实践课程设计报告设计题目:数字钟的设计程序班级:姓名:学号:指导教师:实验日期:年月日1.秒、分60进制计数模块LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYSECONDISPORT(CLK,RESET:INSTD_LOGIC;DATEOUT:OUTSTD_LOGIC_VECTOR(7DOWNTO0);COUT:OUTSTD_LOGIC);ENDSECOND;ARCHITECTUREBEHAVOFSECO
2、NDISSIGNALOLBR:STD_LOGIC_VECTOR(3DOWNTO0);SIGNALOHBR:STD_LOGIC_VECTOR(3DOWNTO0);BEGINPROCESS(CLK,RESET)BEGINIF(RESET='1')THENOLBR<="0000";OHBR<="0000";COUT<='0';ELSIF(CLK'EVENTANDCLK='1')THENIF(OLBR=9ANDOHBR>4)THENOLBR<="0000";OHBR<="0000";COUT<='1';ELSIF(OLBR>8)THENOLBR<="
3、0000";OHBR<=OHBR+1;ELSEOLBR<=OLBR+1;OHBR<=OHBR;COUT<='0';ENDIF;ENDIF;ENDPROCESS;DATEOUT(3DOWNTO0)<=OLBR;DATEOUT(7DOWNTO4)<=OHBR;ENDBEHAV;2.时24进制计数模块LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYHOURISPORT(CLK,RESET:INSTD_LOGIC;DATEOUT:OUTSTD_LO
4、GIC_VECTOR(7DOWNTO0));ENDHOUR;ARCHITECTUREBEHAVOFHOURISSIGNALOLBR:STD_LOGIC_VECTOR(3DOWNTO0);SIGNALOHBR:STD_LOGIC_VECTOR(3DOWNTO0);BEGINPROCESS(CLK,RESET)BEGINIF(RESET='1')THENOLBR<="0000";OHBR<="0000";ELSIF(CLK'EVENTANDCLK='1')THENIF(OLBR=3ANDOHBR>1)THENOLBR<="0000";OHBR<=
5、"0000";ELSIF(OLBR>8)THENOLBR<="0000";OHBR<=OHBR+1;ELSEOLBR<=OLBR+1;OHBR<=OHBR;ENDIF;ENDIF;ENDPROCESS;DATEOUT(3DOWNTO0)<=OLBR;DATEOUT(7DOWNTO4)<=OHBR;ENDBEHAV;3.扫描模块LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYSELTIMEISPORT(CLK1,RESET:INSTD_LOG
6、IC;HOUR:INSTD_LOGIC_VECTOR(7DOWNTO0);MIN,SEC:INSTD_LOGIC_VECTOR(7DOWNTO0);SEL:OUTSTD_LOGIC_VECTOR(2DOWNTO0);DAOUT:OUTSTD_LOGIC_VECTOR(3DOWNTO0));ENDENTITYSELTIME;ARCHITECTUREFUNOFSELTIMEISSIGNALTIME:STD_LOGIC_VECTOR(2DOWNTO0);BEGINSEL<=TIME;PROCESS(CLK1,RESET)BEGINIF(CLK1'E
7、VENTANDCLK1='1')THENIF(RESET='1')THENTIME<="000";ELSIF(TIME="101")THENTIME<="000";ELSETIME<=TIME+1after1000000ns;ENDIF;ENDIF;CASETIMEISWHEN"000"=>DAOUT<=SEC(3DOWNTO0);WHEN"001"=>DAOUT<=SEC(7DOWNTO4);WHEN"010"=>DAOUT<=MIN(3DOWNTO0);WHEN"011"=>DAOUT<=MIN(7DOWNTO4);WHEN"100"=>
8、DAOUT<=HOUR(3DOWNTO0);WHEN"101"=>DAOUT<=HOUR(7DOWNTO4);WHENOTHERS=>NULL;ENDCASE;EN
此文档下载收益归作者所有