版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、设计八 彩灯控制器要求:1、 设计一个彩灯控制器,使彩灯(led管)能连续发出四种以上不同的显示形式;2、随着彩灯显示形式的变化,发出不同的音响声。设计提示:1、彩灯显示的不同形式可由不同进制计数器驱动led显示完成;2、 音响由选择不同频率cp脉冲驱动扬声器形成;3、 彩灯显示形式由实验箱中拨码开关控制。实验程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity caidengkongzhiqi isport(clk1,rst,clk2 : instd_logic;caideng :
2、out std_logic_vector(7 downto 0);cz:in std_logic_vector(1 downto 0);speaker: out std_logic);end caidengkongzhiqi;architecture one of caidengkongzhiqi iscomponent counter_8port(clk,rst : instd_logic;count_out : out integer range 0 to 7);end component ;component caidengkongzhiport(ins:in std_logic_vec
3、tor(1 downto 0);input : in integer range 0 to 7;rst:in std_logic; output : out std_logic_vector(7 downto 0);end component ;component fenpinqiport(clk,rst: instd_logic;clk_10,clk_4,clk_6,clk_8 : out std_logic);end component ;component xzq4_1port( rst:in std_logic; inp:in std_logic_vector(1 downto 0);
4、in1,in2,in3,in4: in std_logic;output : out std_logic);end component ;signal s,g,m,n,k :std_logic; signal f:integer range 0 to 31;signal w:integer range 0 to 3;beginu1: counter_8 port map (clk=clk1, rst=rst, count_out =f);u2: caidengkongzhi port map (ins=cz,input=f, rst=rst, output =caideng);u3: fenp
5、inqi port map (clk=clk2, rst=rst, clk_10=g, clk_4=m, clk_6=n, clk_8=k);u4: xzq4_1 port map (inp=cz,rst=rst, in1=g, in2=m, in3=n, in4=k, output=speaker);end one;library ieee;use ieee.std_logic_1164.all;entity fenpinqi isport(clk,rst: instd_logic;clk_10,clk_4,clk_6,clk_8: out std_logic);end fenpinqi;a
6、rchitecture cd of fenpinqi isbeginp1:process(clk,rst) variable a:integer range 0 to 20; begin if rst=1 then clk_4=3 then a:=0; clk_4=1; else a:=a+1; clk_4=0; end if; end if; end if;end process p1;p2:process(clk,rst) variable b:integer range 0 to 20; begin if rst=1 then clk_6=5 then b:=0; clk_6=1; el
7、se b:=b+1; clk_6=0; end if; end if; end if;end process p2;p3:process(clk,rst) variable c:integer range 0 to 20; begin if rst=1 then clk_8=7 then c:=0; clk_8=1; else c:=c+1; clk_8=0; end if; end if; end if;end process p3;p4:process(clk,rst) variable d:integer range 0 to 20; begin if rst=1 then clk_10
8、=9 then d:=0; clk_10=1; else d:=d+1; clk_10=0; end if; end if; end if;end process p4;end cd;library ieee;use ieee.std_logic_1164.all;entity xzq4_1 isport( rst:in std_logic; inp:in std_logic_vector(1 downto 0);in1,in2,in3,in4: in std_logic;output: out std_logic);end xzq4_1;architecture a of xzq4_1 is
9、beginprocess (rst,inp)begin if(rst=1) then outputoutputoutputoutputoutputnull; end case; end if;end process;end a;library ieee;use ieee.std_logic_1164.all;entity counter_8 isport(clk,rst: instd_logic;count_out: out integer range 0 to 7);end counter_8;architecture a of counter_8 isbeginprocess (rst,c
10、lk) variable temp:integer range 0 to 8;beginif rst=1 then temp:=0;elsif (clkevent and clk=1) then temp:=temp+1; if(temp=8) then temp:=0; end if;end if; count_out=temp;end process;end a;library ieee;use ieee.std_logic_1164.all;entity caidengkongzhi isport(ins:in std_logic_vector(1 downto 0);input: in
11、integer range 0 to 7; rst:in std_logic; output: out std_logic_vector(7 downto 0); end caidengkongzhi;architecture a of caidengkongzhi isbeginprocess (input)begin if rst=1 then outputoutputoutputoutputoutputoutputoutputoutputoutputnull;end case;elsif(ins=01) thencase input iswhen 0=outputoutputoutputoutputoutputoutputoutputoutputnull; end case;elsif(ins=10)thencase input is when 0=outputoutputoutputoutputoutputoutp
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年山西鲁晋特种设备检验检测有限公司招聘备考题库及1套参考答案详解
- 2026年吉林省路桥工程(集团)有限公司西南地区项目部劳务派遣人员招聘13人备考题库有答案详解
- 2026年南昌市昌南学校招聘派遣制教师备考题库完整答案详解
- 2026年中信国安实业集团有限公司招聘备考题库及答案详解1套
- 2026年南京大学事业编制岗位公开招聘15人备考题库带答案详解
- 2026年北京世源希达工程技术有限公司招聘备考题库及答案详解参考
- 2026年广州发展集团股份有限公司招聘备考题库完整参考答案详解
- 2026年哈尔滨市道里区爱建社区卫生服务中心招聘备考题库完整答案详解
- 2026年北部战区空军医院社会招聘44人备考题库及1套参考答案详解
- 2026年恒丰银行深圳分行社会招聘5人备考题库及参考答案详解1套
- 2025至2030中国细胞存储行业调研及市场前景预测评估报告
- 《中华人民共和国危险化学品安全法》解读
- 水暖施工员考试及答案
- 2025年省级行业企业职业技能竞赛(老人能力评估师)历年参考题库含答案
- 2025年淮北市相山区公开招考村(社区)后备干部66人备考题库及一套完整答案详解
- 道路桥梁全寿命周期管理技术研究与成本优化研究毕业答辩汇报
- 2024司法考试卷一《法律职业道德》真题及答案
- 2026年江西冶金职业技术学院单招职业适应性测试题库及参考答案详解1套
- 黑龙江省哈尔滨市第九中学校2024-2025学年高二上学期期末考试生物试题 含解析
- 国家开放大学电大《国际私法》形考任务1-5题库及答案
- 茶艺师培训教材ppt课件
评论
0/150
提交评论