彩灯实验报告.doc

彩灯实验报告.doc

ID:57653606

大小:161.00 KB

页数:9页

时间:2020-08-30

彩灯实验报告.doc_第1页
彩灯实验报告.doc_第2页
彩灯实验报告.doc_第3页
彩灯实验报告.doc_第4页
彩灯实验报告.doc_第5页
资源描述:

《彩灯实验报告.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、........设计八彩灯控制器要求:1、设计一个彩灯控制器,使彩灯(LED管)能连续发出四种以上不同的显示形式;2、随着彩灯显示形式的变化,发出不同的音响声。设计提示:1、彩灯显示的不同形式可由不同进制计数器驱动LED显示完成;2、音响由选择不同频率CP脉冲驱动扬声器形成;3、彩灯显示形式由实验箱中拨码开关控制。实验程序LIBRARYieee;USEieee.std_logic_1164.all;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYcaidengkongzhiqiISPORT(c

2、lk1,rst,clk2:INstd_logic;caideng:OUTstd_logic_vector(7downto0);cz:instd_logic_vector(1downto0);speaker:outstd_logic);ENDcaidengkongzhiqi;ARCHITECTUREoneOFcaidengkongzhiqiISCOMPONENTcounter_8PORT(clk,rst:INstd_logic;count_out:OUTintegerrange0to7);ENDCOMPONENT;COM

3、PONENTcaidengkongzhiPORT(Ins:instd_logic_vector(1downto0);Input:ININTEGERRANGE0TO7;Rst:instd_logic;output:OUTstd_logic_vector(7downto0));ENDCOMPONENT;COMPONENTfenpinqi.s...............PORT(clk,rst:INstd_logic;clk_10,clk_4,clk_6,clk_8:OUTstd_logic);ENDCOMPONENT;C

4、OMPONENTxzq4_1PORT(Rst:instd_logic;Inp:instd_logic_vector(1downto0);in1,in2,in3,in4:Instd_logic;output:OUTstd_logic);ENDCOMPONENT;SIGNALs,g,m,n,k:std_logic;SIGNALf:INTEGERRANGE0TO31;SIGNALw:integerrange0to3;BEGINu1:counter_8portmap(clk=>clk1,rst=>rst,count_out=>

5、f);u2:caidengkongzhiportmap(ins=>cz,input=>f,rst=>rst,output=>caideng);u3:fenpinqiportmap(clk=>clk2,rst=>rst,clk_10=>g,clk_4=>m,clk_6=>n,clk_8=>k);u4:xzq4_1portmap(inp=>cz,rst=>rst,in1=>g,in2=>m,in3=>n,in4=>k,output=>speaker);ENDone;LIBRARYieee;USEieee.std_logic

6、_1164.all;ENTITYfenpinqiISPORT(clk,rst:INstd_logic;clk_10,clk_4,clk_6,clk_8:OUTstd_logic);ENDfenpinqi;ARCHITECTUREcdOFfenpinqiISbeginp1:process(clk,rst)variablea:integerrange0to20;.s...............beginifrst='1'thenclk_4<='0';a:=0;elseifclk'eventandclk='1'thenif

7、a>=3thena:=0;clk_4<='1';elsea:=a+1;clk_4<='0';endif;endif;endif;endprocessp1;p2:process(clk,rst)variableb:integerrange0to20;beginifrst='1'thenclk_6<='0';b:=0;elseifclk'eventandclk='1'thenifb>=5thenb:=0;clk_6<='1';elseb:=b+1;clk_6<='0';endif;endif;endif;endproces

8、sp2;p3:process(clk,rst)variablec:integerrange0to20;beginifrst='1'thenclk_8<='0';c:=0;.s...............elseifclk'eventandclk='1'thenifc>=7thenc:=0;clk_8<='1';elsec:=c+

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。