欢迎来到天天文库
浏览记录
ID:14013873
大小:68.00 KB
页数:6页
时间:2018-07-25
《eda流水灯底层文件代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.STD_LOGIC_UNSIGNED.ALL;entitydivisPORT(CLK_IN:INSTD_LOGIC;--输入时钟信号CLK_OUT:OUTSTD_LOGIC--分频后的输出时钟信号);enddiv;architectureBehavioralofdivissignalcont:STD_logic_vector(1downto0);beginprocess(CLK_IN)BEGINIFRISING_EDGE(CL
2、K_IN)THENIFCONT="11"THENCONT<="00";CLK_OUT<='1';ELSECONT<=CONT+'1';CLK_OUT<='0';ENDIF;ENDIF;ENDPROCESS;endBehavioral;libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.STD_LOGIC_UNSIGNED.ALL;entityled0isPORT(CLK:INSTD_LOGIC;--分频后的时钟信号EN:INSTD_LOGIC;--使能控制信号M:OUTSTD_
3、LOGIC_VECTOR(7DOWNTO0)--控制8个灯的输出信号);endled0;architectureBehavioralofled0isSIGNALSEL:STD_LOGIC_VECTOR(2DOWNTO0);beginPROCESS(EN,CLK,SEL)BEGINIFRISING_EDGE(CLK)THENIFEN='1'THENIFSEL="111"THENSEL<="000";ELSESEL<=SEL+'1';ENDIF;ENDIF;ENDIF;CASESELISWHEN"000"=>M<="10000000";WHEN"001"=>M<="010000
4、00";WHEN"010"=>M<="00100000";WHEN"011"=>M<="00010000";WHEN"100"=>M<="00001000";WHEN"101"=>M<="00000100";WHEN"110"=>M<="00000010";WHEN"111"=>M<="00000001";WHENOTHERS=>NULL;ENDCASE;ENDPROCESS;endBehavioral;libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.STD_LOGIC_U
5、NSIGNED.ALL;entityled1isPORT(CLK:INSTD_LOGIC;--分频后的时钟信号EN:INSTD_LOGIC;--使能控制信号N:OUTSTD_LOGIC_VECTOR(7DOWNTO0)--控制8个灯的输出信号);endled1;architectureBehavioralofled1isSIGNALSEL:STD_LOGIC_VECTOR(2DOWNTO0);beginPROCESS(EN,CLK,SEL)BEGINIFRISING_EDGE(CLK)THENIFEN='1'THENIFSEL="111"THENSEL<="000";ELS
6、ESEL<=SEL+'1';ENDIF;ENDIF;ENDIF;CASESELISWHEN"000"=>N<="00000001";WHEN"001"=>N<="00000010";WHEN"010"=>N<="00000100";WHEN"011"=>N<="00001000";WHEN"100"=>N<="00010000";WHEN"101"=>N<="00100000";WHEN"110"=>N<="01000000";WHEN"111"=>N<="10000000";WHENOTHERS=>NULL;ENDCASE;ENDPROCESS;endBehavioral
7、;libraryIEEE;useIEEE.STD_LOGIC_1164.ALL;useIEEE.STD_LOGIC_ARITH.ALL;useIEEE.STD_LOGIC_UNSIGNED.ALL;entityled2isPORT(CLK:INSTD_LOGIC;--分频后的时钟信号EN:INSTD_LOGIC;--使能控制信号L:OUTSTD_LOGIC_VECTOR(7DOWNTO0)--控制8个灯的输出信号);endled2;architectureBehavioralofled2isSIGNALSEL:ST
此文档下载收益归作者所有