欢迎来到天天文库
浏览记录
ID:56867414
大小:554.50 KB
页数:11页
时间:2020-07-16
《数电实验实验报告(Quartus)数码管循环显示.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验101、结果:同时显示代码:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYsweepISPORT(clk,clr:INSTD_LOGIC;--clk输入时钟;clr状态清零a:OUTSTD_LOGIC_VECTOR(6DOWNTO0);--输出数码管相同段sweep:OUTSTD_LOGIC_VECTOR(5DOWNTO0)--输出cat(数码管选通控制信号)端);ENDsweep;ARCHITECTUREsweep_archOFsweepISSIGNALsweep_arc:ST
2、D_LOGIC_VECTOR(5DOWNTO0);--声明内部信号(选通控制信号)SIGNALb:STD_LOGIC_VECTOR(6DOWNTO0);--声明内部信号(相同段信号)BEGINPROCESS(sweep_arc)BEGINIF(clk'eventandclk='1')THENIFclr='0'THEN--状态清零sweep_arc<="";b<="";ELSEcasesweep_arcIS--选通控制信号WHEN""=>sweep_arc<="";WHEN""=>sweep_arc<="";WHEN""=>sw
3、eep_arc<="";WHEN""=>sweep_arc<="";WHEN""=>sweep_arc<="";WHEN""=>sweep_arc<="";WHENOTHERS=>sweep_arc<="";ENDCASE;CASEsweep_arcIS--相同段信号WHEN""=>b<="";WHEN""=>b<="";WHEN""=>b<="";WHEN""=>b<="";WHEN""=>b<="";WHEN""=>b<="";WHENOTHERS=>b<="";ENDCASE;ENDIF;ENDIF;sweep<=swe
4、ep_arc;a<=b;ENDPROCESS;END;仿真:管脚:2、(1)结果:循环显示:——————代码:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYsweep2ISPORT(clk:INSTD_LOGIC;--clk输入时钟sweep2:OUTSTD_LOGIC_VECTOR(5DOWNTO0);--输出数码管相同段a:OUTSTD_LOGIC_VECTOR(6DOWNTO0)--输出cat(数码管选通控制信号)端
5、);ENDsweep2;ARCHITECTUREarc_sweep2OFsweep2ISSIGNALnumber:INTEGERRANGE0TO6;--状态声明(6种状态,7种状态值)SIGNALn:INTEGERRANGE0TO6;--声明数码管(6个管,7个值)SIGNALflag:INTEGERRANGE0TO50;--同一状态运行次数BEGINPROCESS(clk)BEGINIF(clk'eventANDclk='1')THENIFn>5THENn<=0;ELSEn<=n+1;flag<=flag+1;ENDIF;I
6、Fflag>20THENflag<=0;number<=number+1;ENDIF;IFnumber>5THENnumber<=0;ENDIF;CASEnumberISWHEN0=>--状态0,输出CASEnISWHEN0=>sweep2<="";a<="";WHEN1=>sweep2<="";a<="";WHEN2=>sweep2<="";a<="";WHEN3=>sweep2<="";a<="";WHEN4=>sweep2<="";a<="";WHEN5=>sweep2<="";a<="";WHENOTHERS=>swe
7、ep2<="";ENDCASE;WHEN1=>----状态1,输出CASEnISWHEN0=>sweep2<="";a<="";WHEN1=>sweep2<="";a<="";WHEN2=>sweep2<="";a<="";WHEN3=>sweep2<="";a<="";WHEN4=>sweep2<="";a<="";WHEN5=>sweep2<="";a<="";WHENOTHERS=>sweep2<="";ENDCASE;WHEN2=>--状态2,输出CASEnISWHEN0=>sweep2<="";a<="";WHEN1
8、=>sweep2<="";a<="";WHEN2=>sweep2<="";a<="";WHEN3=>sweep2<="";a<="";WHEN4=>sweep2<="";a<="";WHEN5=>sweep2<="";a<="";WHENOTHERS=>sweep2<="";
此文档下载收益归作者所有