成绩评定表学生姓名田大露班级学号1303060220 专业通信工程课程设计题目音量控制电路的设计与实现评语组长签字:成绩日期20 年月日课程设计任务书学院信息科学与工程学院专业通信工程学生姓名田大露班级学号 1203060220课程设计题目音量控制电路的设计与实现实践教学要求与任务:1、熟悉音量控制电路的基本原理2、熟悉quartersⅡ的环境3、熟悉Multisim环境4、对音量控制电路进行结果验证及分析工作计划与进度安排:第一周熟悉Multisim环境及QuartusⅡ环境,练习数字系统设计方法,包括采用触发器设计和超高速硬件描述语言设计,体会自上而下、自下而上设计方法的优缺点。
第二周 1、在QuartusⅡ环境中用VHDL语言实现音量控制电路在仿真器上显示结果波形,并下载到目标芯片上,在实验箱上观察输出结果。
2、在Multisim环境中仿真实现数字计步器,并通过虚拟仪器验证其正确性。
指导教师:201 年月日专业负责人:201 年月日学院教学副院长:201 年月日摘要本设计是在前导验证性认知实验的基础上,进行更高层次的命题设计实验——十二级数字音量控制电路,在教师指导下独立查阅资料、设计、特定功能的电子电路。
以此培养利用模拟、数字电路知识,解决电子线路中常见实际问题的能力,积累实际电子制作经验,目的在于巩固基础、注重设计、培养技能、追求创新、走向成功。
将介绍一种由数字电路构成音量控制电路的设计方法。
这种数字式音量自动控制电路将是未来音量控制发展的主流,将越来越受消费者喜爱。
在音响设备中通常采用电位器进行音量控制。
但经常进行音量控制时,又容易使电位器磨损而出故障而采用数字式音量控制就可以避免模拟调节易受干扰的缺点,而且操作控制更加方便。
关键字:音量控制电路;电位器;数字式目录一、课程设计目的 (5)二、课程题目实现框图 (5)三、实现过程 (5)3.1Q UARTUS II8.1实现过程(VHDL) (5)3.1.1 建立工程 (6)3.1.2 编译程序 (9)3.1.3 波形仿真 (18)3.1.4引脚锁定与下载 (20)3.2M ULTISIM 实现过程(电路设计) (21)3.2.1单元功能电路设计 (21)3.2.2 画逻辑电路图 (23)3.2.3 逻辑分析仪的仿真 (24)3.2.4 仿真结果分析 (24)四、设计总结 (24)五、参考文献 (26)一、 课程设计目的1、了解数字系统设计方法。
2、熟悉VHDL 语言及其仿真环境、下载方法。
3、熟悉Multisim 环境,学会使用逻辑符号及元件画逻辑电路图。
二、课程题目实现框图1、。
如图2-1所示是音量控制电路的结构示意框图。
三、实现过程3.1 QuartusII8.1实现过程(VHDL)图2-1 结构示意框图显示器译码器计数器3.1.1 建立工程(1)启动QUARTUS软件,如图3-1 所示:图3-1 QUARTUS软件的启动界面(2)点击File –> New Project Wizard创建一个新工程,如图3-2所示:图3-2 工程创建向导的启始页(3)点击Next,为工程选择存储目录、工程名称、顶层实体名等,如图3-3所示;图3-3 输入工程名称、存储目录(4)点击Next,若目录不存在,系统可能提示创建新目录,点击“是”按钮创建新目录,如图3-4所示;图3-4 提示是否添加文件(5)点击Next,进入设备选择对话框,这里选中实验箱的核心芯片CYCLONE系列FPGA 产品EP1C6Q240C8,如图3-5所示;图3-5 芯片型号选择(6)点击Next,提示是否需要其他EDA工具,这里不选任何其他工具,如图3-6;图3-6 提示是否利用其他EDA设计工具(7)点击Next后,系统提示创建工程的各属性总结,若没有错误,点击Finish,工程创建向导将生成一个工程,在窗口左侧显示出设备型号和该工程的基本信息等。
如图3-7所示:图3-7 工程阐述汇总3.1.2 编译程序为实现用一个拨码开关控制一个LED亮灭的功能,可用VHDL编写一个程序实现,具体操作过程如下:(1)点击File->New创建一个设计文件,如图3-8所示;图3-8 创建一个设计文件(2)选择设计文件的类型为VHDL File;(3)点击OK,窗口右侧为VHDL的编辑窗口,如图3-9所示:图 3-9 新建的一个VHDL源文件的编辑窗口(4)在编辑窗口中编辑以下程序:library ieee;use ieee.std_logic_1164.all;entity jibuqi isport(scan_clk:in std_logic;clk0,alter,start: in std_logic;S :out std_logic_vector(5 downto0);a,b,c,d,e,f,g :out std_logic);end jibuqi;architecture arch of jibuqi issignal t :std_logic_vector(3 downto 0);signal r :std_logic_vector(6 downto 0);signal clk :std_logic;signal Q1,Q2,Q3,Q4,P1,P2,P3,P4:std_logic_vector(3 downto 0); signal X1,X2,X3,X4,X5:std_logic_vector(3 downto 0);beginU1:process(start,clk0)beginclk <=start and clk0;end process;U2:process(clk)beginif clk'event and clk='1' thenif Q1="0000" then Q1<="0001";elsif Q1="0001" then Q1<="0010";elsif Q1="0010" then Q1<="0011";elsif Q1="0011" then Q1<="0100";elsif Q1="0100" then Q1<="0101";elsif Q1="0101" then Q1<="0110";elsif Q1="0110" then Q1<="0111";elsif Q1="0111" then Q1<="1000";elsif Q1="1000" then Q1<="1001";elsif Q1="1001" then Q1<="0000";end if;end if;if Q1' event and Q1="0000" thenif Q2="0000" then Q2<="0001";elsif Q2="0001" then Q2<="0010";elsif Q2="0010" then Q2<="0011";elsif Q2="0011" then Q2<="0100";elsif Q2="0100" then Q2<="0101";elsif Q2="0101" then Q2<="0110";elsif Q2="0110" then Q2<="0111";elsif Q2="0111" then Q2<="1000"; elsif Q2="1000" then Q2<="1001"; elsif Q2="1001" then Q2<="0000"; end if;end if;if Q2' event and Q2="0000" thenif Q3="0000" then Q2<="0001";elsif Q3="0001" then Q3<="0010";elsif Q3="0010" then Q3<="0011";elsif Q3="0011" then Q3<="0100";elsif Q3="0100" then Q3<="0101";elsif Q3="0101" then Q3<="0110";elsif Q3="0110" then Q3<="0111";elsif Q3="0111" then Q3<="1000";elsif Q3="1000" then Q3<="1001";elsif Q3="1001" then Q3<="0000"; end if;end if;if Q3' event and Q3="0000" thenif Q4="0000" then Q4<="0001";elsif Q4="0001" then Q4<="0010";elsif Q4="0010" then Q4<="0011";elsif Q4="0011" then Q4<="0100";elsif Q4="0100" then Q4<="0101";elsif Q4="0101" then Q4<="0110";elsif Q4="0110" then Q4<="0111";elsif Q4="0111" then Q4<="1000";elsif Q4="1000" then Q4<="1001";elsif Q4="1001" then Q4<="0000"; end if;end if;if clk'event and clk='1' then if P1="0000" then P1<="0100";elsif P1="0100" then P1<="1000";elsif P1="1000" then P1<="0010";elsif P1="0010" then P1<="0110";elsif P1="0110" then P1<="0000"; end if;end if;if P1'event and P1="0000" thenif P2="0000" then P2<="0001";elsif P2="0001" then P2<="0010";elsif P2="0010" then P2<="0011";elsif P2="0011" then P2<="0100";elsif P2="0100" then P2<="0101";elsif P2="0101" then P2<="0110";elsif P2="0110" then P2<="0111";elsif P2="0111" then P2<="1000";elsif P2="1000" then P2<="1001";elsif P2="1001" then P2<="0000"; end if;end if;if P2'event and P2="0000" thenif P3="0000" then P3<="0001";elsif P3="0001" then P3<="0010";elsif P3="0010" then P3<="0011";elsif P3="0011" then P3<="0100";elsif P3="0100" then P3<="0101";elsif P3="0101" then P3<="0110";elsif P3="0110" then P3<="0111";elsif P3="0111" then P3<="1000";elsif P3="1000" then P3<="1001";elsif P3="1001" then P3<="0000"; end if;end if;if P3'event and P3="0000" thenif P4="0000" then P4<="0001";elsif P4="0001" then P4<="0010";elsif P4="0010" then P4<="0011";elsif P4="0011" then P4<="0100";elsif P4="0100" then P4<="0101";elsif P4="0101" then P4<="0110";elsif P4="0110" then P4<="0111";elsif P4="0111" then P4<="1000";elsif P4="1000" then P4<="1001";elsif P4="1001" then P4<="0000"; end if;end if;end process;U4:process(alter)beginif alter='0'then X1 <= Q1;X2 <= Q2;X3 <= Q3;X4 <= Q4;X5 <= "1111";else X1 <= "0000";X2 <= P1;X3 <= P2;X4 <= P3;X5 <= P4;end if;end process;U5:process(scan_clk)variable S1:std_logic_vector(4 downto 0):="10000"; beginif scan_clk'event and scan_clk='1' thenif S1="10000" thenS1:="01000";elsif S1="01000" thenS1:="00100";elsif S1="00100" thenS1:="00010";elsif S1="00010" thenS1:="00001";elsif S1="00001" thenS1:="00000";end if;end if;if S1="10000" then t<=X5;elsif S1="01000" then t<=X4;elsif S1="00100" then t<=X3;elsif S1="00010" then t<=X2;elsif S1="00001" then t<=X1;end if;S<=S1;end process;U6:process(t)begincase t iswhen "0000" => r<="0111111";when "0001" => r<="0000110";when "0010" => r<="1011011";when "0011" => r<="1001111";when "0100" => r<="1100110";when "0101" => r<="1101101";when "0110" => r<="1111101";when "0111" => r<="0000111";when "1000" => r<="1101111";when "1001" => r<="1101111";when "1111" => r<="0000000";when others => null;end case;end process;g<=r(6);f<=r(5);e<=r(4);d<=r(3);c<=r(2);b<=r(1);a<=r(0);end arch;(5)输入程序后,存盘,如图3-10所示:图3-10 存盘( 6 ) 点击Processing->Start Compilation编译该文件,系统将开始编译,结束后,给出提示信息和编译结果,如图3-11所示:图3-11 编译结果显示3.1.3 波形仿真(1 )建立时序仿真文件,选择“Vector Waveform File”,如图3-12所示:图3-12 建立时序仿真文件(2)出现图3-13的界面,在Name空白处击右键,Insert→Insert Node or Bus 。