资源描述:
《胡俊设计任务书》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、电子信息工程专业在系统编程技术课程设计任务书学生姓名学号:班级:题目:数字时钟设计主要内容及目标:1、要求用七段数码管显示秒、分、时,具体格式如下2、所设计的时钟要有清零和调时的功能设计模块图组成(主模块及所有子模块):1、秒模块LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYsecondISPORT(ENA,RES,CLK:INSTD_LOGIC;OUT0,OUT1:OUTSTD_LOGIC_VECTOR(3D
2、OWNTO0);CA:OUTSTD_LOGIC);ENDsecond;ARCHITECTURESECOFsecondISSIGNALCLK1:STD_LOGIC;BEGINPROCESS(ENA,CLK,RES)VARIABLEM0,M1:STD_LOGIC_VECTOR(3DOWNTO0);BEGINIFRES='1'THENM0:="0000";M1:="0000";CA<='0';CLK1<='0';ELSIFCLK'EVENTANDCLK='1'THENCA<='0';CLK1<='0';IFENA='1'
3、THENIFM0="1001"ANDM1="0101"THENCA<='1';CLK1<='1';ENDIF;IFM0<"1001"THENM0:=M0+1;ELSEM0:="0000";M1:=M1+1;IFM1>"0101"THENM0:="0000";M1:="0000";ENDIF;ENDIF;ENDIF;ENDIF;OUT0<=M0;OUT1<=M1;ENDPROCESS;ENDSEC;2、分模块LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGI
4、C_UNSIGNED.ALL;ENTITYminuteISPORT(ENA,RES,CLK,SADD,SC:INSTD_LOGIC;OUT0,OUT1:OUTSTD_LOGIC_VECTOR(3DOWNTO0);CB:OUTSTD_LOGIC);ENDminute;ARCHITECTURESECOFminuteISBEGINminute:PROCESS(ENA,CLK,RES)VARIABLEM0,M1:STD_LOGIC_VECTOR(3DOWNTO0);BEGINIFRES='1'THENM0:="0000";
5、M1:="0000";CB<='0';ELSIFCLK'EVENTANDCLK='1'THENCB<='0';IFENA='1'THENIFM0="1001"ANDM1="0101"THENCB<='1';ENDIF;IFM0<"1001"THENM0:=M0+1;ELSEM0:="0000";M1:=M1+1;IFM1>"0101"THENM0:="0000";M1:="0000";ENDIF;ENDIF;ENDIF;ENDIF;OUT0<=M0;OUT1<=M1;ENDPROCESSminute;ENDSEC;
6、3、小时模块LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYhourISPORT(ENA,RES,CLK:INSTD_LOGIC;OUT0,OUT1:OUTSTD_LOGIC_VECTOR(3DOWNTO0);CC:OUTSTD_LOGIC);ENDhour;ARCHITECTURESECOFhourISBEGINhour:PROCESS(ENA,CLK,RES)VARIABLEH0,H1:STD_LOGIC_V
7、ECTOR(3DOWNTO0);BEGINIFRES='1'THENH0:="0000";H1:="0000";CC<='0';ELSIFCLK'EVENTANDCLK='1'THENCC<='0';IFENA='1'THENIFH0="0011"ANDH1="0010"THENCC<='1';H0:="0000";H1:="0000";ENDIF;IFH0<"1001"THENH0:=H0+1;ELSEH0:="0000";H1:=H1+1;IFH1>"0010"THENH0:="0000";H1:="0000"
8、;ENDIF;ENDIF;ENDIF;ENDIF;OUT0<=H0;OUT1<=H1;ENDPROCESShour;ENDSEC;显示模块LED1:PROCESS(T1)BEGINCASET1ISWHEN"0000"=>LED7S1<="0111111";WHEN"0001"=>LED7S1<="0000110";WHEN"0010"=>LED7S1<="1