




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 IEC 60794-2-20:2024 EN-FR Optical fibre cables - Part 2-20: Indoor cables - Family specification for multi-fibre optical cables
- 2025-2030年中国锂电池负极材料市场运行状况与前景趋势分析报告
- 2025-2030年中国钢帘线市场发展现状及前景趋势分析报告
- 2025-2030年中国西乐器制造市场十三五规划及投资策略研究报告
- 2025-2030年中国茄尼醇行业风险评估规划研究报告
- 2025-2030年中国红花籽油市场运行状况及未来发展趋势预测报告
- 贵州应用技术职业学院《传热学B》2023-2024学年第二学期期末试卷
- 伊犁师范大学《中学思想政治课程与教学论》2023-2024学年第二学期期末试卷
- 抚州职业技术学院《无机非金属材料机械设备》2023-2024学年第二学期期末试卷
- 贵州工程应用技术学院《经济写作》2023-2024学年第二学期期末试卷
- 三晋卓越联盟·山西省2024-2025学年度高三9月质量检测+语文试卷
- 《那一刻我长大了》习作课件
- 教科版小学科学六年级上册期末考试试卷(含答案)
- 父母买房在子女名下协议书范本
- DBJ15 31-2016建筑地基基础设计规范(广东省标准)
- 高危新生儿管理专家共识解读
- 《纺织服装材料》课件-0绪论
- 盘扣式卸料平台施工方案
- 绘本故事在小学道德与法治课堂中的有效教学策略分析
- 2024核桃树承包合同
- 保险授权书格式模板
评论
0/150
提交评论