欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    EDA课程设计论文简易乐器演奏器.doc

    • 资源ID:4856140       资源大小:300.53KB        全文页数:18页
    • 资源格式: DOC        下载积分:10金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    EDA课程设计论文简易乐器演奏器.doc

    课程设计说明书1 引言随着电子技术的飞速发展,微电子技术的进步主要表现在大规模集成电路加工技术即半导体工艺技术的发展上,使得表征半导体的工艺水平的线宽已经达到了60nm,并在不断地缩小,面在硅片单位面积上,集成了更多的晶体管。集成电路设计正在不断地向超大规模,极低功耗和超高速的方向发展,电子产品的功能越来越强大,体积越来越小,功耗越来越低。同时,利用可编程逻辑器件和EDA 技术使设计方法发生了质的变化。把以前“电路设计+硬件搭试+调试焊接”转化为“功能设计+软件模拟+仿真下载”。利用EDA 开发平台,采用可编程逻辑器件CPLDFPGA 使硬件的功能可通过编程来实现,这种新的基于芯片的设计方法能够使设计者有更多机会充分发挥创造性思维,实现多种复杂数字逻辑系统的功能,将原来由电路板设计完成的工作放到芯片的设计中进行,减少了连线和体积,提高了集成度,降低了干扰,大大减轻了电路设计和PCB设计的工作量和难度,增强了设计的灵活性,有效地提高了工作效率,增加了系统的可靠性和稳定性,提高了技术指标。这些技术使得各种电子产品迅速的进入了我们的生活,我们处在一个被电子产品深度包围的时代,在一个普通老百姓的家里,衣食住行,每一个产品的诞生都离不开EDA技术,从彩色电视机,到智能冰箱,到全自动洗衣机,电饭煲,到微波炉,电磁炉,电子琴,再到个人随身用的手机,MP3音乐播放器都需要EDA技术提供支持。本文应用VHDL硬件描述语言,设计一个乐曲硬件演奏电路,它能将一首预先设置存储好的乐曲自动播放出来,除此之外,也能够通过按键的方式输入音符,使其具备简易电子琴的功能。通过此项研究,能够深切的体会利用EDA工具开发的优越性,在此基础上,对乐曲硬件演奏电路功能进行丰富,具体一定的社会实用性。2 EDA技术2.1 简介EDA技术是在电子CAD技术基础上发展起来的计算机软件系统,是指以计算机为工作平台,融合了应用电子技术、计算机技术、信息处理及智能化技术的最新成果,进行电子产品的自动设计。 利用EDA工具,电子设计师可以从概念、算法、协议等开始设计电子系统,大量工作可以通过计算机完成,并可以将电子产品从电路设计、性能分析到设计出IC版图或PCB版图的整个过程的计算机上自动处理完成。现在对EDA的概念或范畴用得很宽。包括在机械、电子、通信、航空航天、化工、矿产、生物、医学、军事等各个领域,都有EDA的应用。目前EDA技术已在各大公司、企事业单位和科研教学部门广泛使用。例如在飞机制造过程中,从设计、性能测试及特性分析直到飞行模拟,都可能涉及到EDA技术。本文所指的EDA技术,主要针对电子电路设计、PCB设计和IC设计。2.2 硬件描述语言VHDL 2.2.1 VHDL的简介 VHDL的英文全名是Very-High-Speed Integrated Circuit HardwareDescription Language,诞生于1982年。1987年底,VHDL被IEEE和美国国防部确认为标准硬件描述语言。VHDL语言是一种用于电路设计的高级语言,主要用于描述数字系统的结构,行为,功能和接口。除了含有许多具有硬件特征的语句外,VHDL的语言形式和描述风格与句法是十分类似于一般的计算机高级语言。VHDL的程序结构特点是将一项工程设计,或称设计实体(可以是一个元件,一个电路模块或一个系统)分成外部(或称可是部分,及端口)和内部(或称不可视部分),既涉及实体的内部功能和算法完成部分。在对一个设计实体定义了外部界面后,一旦其内部开发完成后,其他的设计就可以直接调用这个实体。2.2.2 VHDL语言的特点 功能强大、设计灵活。支持广泛、易于修改。强大的系统硬件描述能力。独立于器件的设计、与工艺无关。很强的移植能力。2.2.3 VHDL的设计流程 用VHDL语言设计电路的流程:在用VHDL语言来设计电路时,主要的过程是这样的:(1)使用文本编辑器输入设计源文件。(2)使用编译工具编译源文件。VHDL的编译器有很多,ACTIVE公司,MODELSIM公司,SYNPLICITY公司,SYNOPSYS公司,VERIBEST公司等都有自己的编译器。(3)功能仿真。对于某些人而言,仿真这一步似乎是可有可无的。但是对于一个可靠的设计而言,任何设计最好都进行仿真,以保证设计的可靠性。另外,对于作为一个独立的设计项目而言,仿真文件的提供足可以证明你设计的完整性。 (4)综合。综合的目的是在于将设计的源文件由语言转换为实际的电路。这一部分的最终目的是生成门电路级的网表(Netlist)。(5)布局、布线。这一步的目的是生成用于烧写的编程文件。在这一步,将用到第(4)步生成的网表并根据CPLD/FPG厂商的器件容量,结构等进行布局、布线。这就好像在设计PCB时的布局布线一样。先将各个设计中的门根据网表的内容和器件的结构放在器件的特定部位。然后,在根据网表中提供的各门的连接,把各个门的输入输出连接起来。(6)最后仿真。这一步主要是为了确定设计在经过布局布线之后,是不是还满足原本的设计要求。3 简易电子琴设计过程3.1简易电子琴的工作原理 音乐产生原理及硬件设计由于一首音乐是许多不同的音阶组成的,而每个音阶对应着不同的频率,这样我们就可以利用不同的频率的组合,即可构成我们所想要的音乐了,当然对于单片机来产生不同的频率非常方便,我们可以利用单片机的定时/计数器来产生这样方波频率信号,因此,我们只要把一首歌曲的音阶对应频率关系弄正确即可。该电子琴可以实现两个功能,用按键CS来选择不同功能,第一种功能是用手动即通过按键的形式输入不同音名,第二种功能是音乐发生器,可以自动重复播放儿童歌曲“种太阳”音乐。当CS为高电平1时,选择功能二,当CS为低电平0时,选择功能一。3.2简易电子琴的工作流程图 开始按键按下是否成功TO初始化并开中断允放TO中断识别按键功能根据按键功能,装入音符T到TO中启动TO工作按键释放是否成功?停止TO工作3.3简易电子琴中各模块的设计 系统内部结构图如图3.1所示图3.13.3.1分频器fpq1模块1.分频器1的程序library ieee;use ieee.std_logic_1164.all;entity fpq1 isport(clk12:in std_logic; clk1:buffer std_logic);end fpq1;architecture bhv of fpq1 isbeginprocess(clk12)variable count:integer range 0 to 1200;beginif clk12'event and clk12='1' thencount:=count+1;if count=1200 thenclk1<=not clk1;count:=0;end if;end if;end process;end bhv;2.分频器1的仿真图 3.3.2分频器fpq2模块程序1.分频器2的程序library ieee;use ieee.std_logic_1164.all;entity fpq2 isport(clk1:in std_logic; clk2:buffer std_logic);end fpq2;architecture bhv of fpq2 isbeginprocess(clk1)variable count:integer range 0 to 500;beginif clk1'event and clk1='1' thencount:=count+1;if count=500 thenclk2<=not clk2;count:=0;end if;end if;end process;end bhv;2.分频器2的仿真图3.3.3琴/乐功能选择器bmux模块程序1.功能选择器的程序library ieee;use ieee.std_logic_1164.all;entity bmux is port(index1:in std_logic_vector(3 downto 0);index2:in std_logic_vector(3 downto 0);cs :in std_logic;toneindex:out std_logic_vector(3 downto 0);end;architecture bhv of bmux isbeginprocess(cs)begincase cs iswhen '0'=>toneindex<=index1;when '1'=>toneindex<=index2;when others=>toneindex<=null;end case;end process;end bhv;3.3.2乐曲自动演奏notetabs模块程序library ieee;use ieee.std_logic_1164.all;entity notetabs isport(clk:in std_logic; toneindex2:out std_logic_vector(3 downto 0);end notetabs;architecture one of notetabs issignal counter:integer range 0 to 138;beginprocess(clk)beginif counter=138 thencounter<=0;elsif clk'event and clk='1'thencounter<=counter+1;end if;end process;process(counter)begincase counter iswhen 00=>toneindex2<="0101"when 01=>toneindex2<="0110"when 02=>toneindex2<="0101"when 03=>toneindex2<="0101"when 04=>toneindex2<="1011"when 05=>toneindex2<="1011"when 06=>toneindex2<="1001"when 07=>toneindex2<="1001"when 08=>toneindex2<="0101"when 09=>toneindex2<="0110"when 10=>toneindex2<="0101"when 11=>toneindex2<="0101"when 12=>toneindex2<="1011"when 13=>toneindex2<="1011"when 14=>toneindex2<="1001"when 15=>toneindex2<="1001"when 16=>toneindex2<="0011"when 17=>toneindex2<="0100"when 18=>toneindex2<="0101"when 19=>toneindex2<="0101"when 20=>toneindex2<="0101"when 21=>toneindex2<="0101"when 22=>toneindex2<="1001"when 23=>toneindex2<="1001"when 24=>toneindex2<="0101"when 25=>toneindex2<="0101"when 26=>toneindex2<="0111"when 27=>toneindex2<="0110"when 28=>toneindex2<="0110"when 29=>toneindex2<="0110"when 30=>toneindex2<="0000"when 31=>toneindex2<="0000"when 32=>toneindex2<="0100"when 33=>toneindex2<="0100"when 34=>toneindex2<="1010"when 35=>toneindex2<="1010"when 36=>toneindex2<="0111"when 37=>toneindex2<="0111"when 38=>toneindex2<="0010"when 39=>toneindex2<="0011"when 40=>toneindex2<="0100"when 41=>toneindex2<="0100"when 42=>toneindex2<="1001"when 43=>toneindex2<="1001"when 44=>toneindex2<="0111"when 45=>toneindex2<="0111"when 46=>toneindex2<="0111"when 47=>toneindex2<="0110"when 48=>toneindex2<="0101"when 49=>toneindex2<="0101"when 50=>toneindex2<="0110"when 51=>toneindex2<="0111"when 52=>toneindex2<="1001"when 53=>toneindex2<="1001"when 54=>toneindex2<="0101"when 55=>toneindex2<="0110"when 56=>toneindex2<="0101"when 57=>toneindex2<="0100"when 58=>toneindex2<="0011"when 59=>toneindex2<="0011"when 60=>toneindex2<="0000"when 61=>toneindex2<="0000"when 62=>toneindex2<="0101"when 63=>toneindex2<="0110"when 64=>toneindex2<="0101"when 65=>toneindex2<="0101"when 66=>toneindex2<="1011"when 67=>toneindex2<="1011"when 68=>toneindex2<="1001"when 69=>toneindex2<="1001"when 70=>toneindex2<="0101"when 71=>toneindex2<="0110"when 72=>toneindex2<="0101"when 73=>toneindex2<="0101"when 74=>toneindex2<="1011"when 75=>toneindex2<="1011"when 76=>toneindex2<="1001"when 77=>toneindex2<="1001"when 78=>toneindex2<="0101"when 79=>toneindex2<="0110"when 80=>toneindex2<="0111"when 81=>toneindex2<="0111"when 82=>toneindex2<="0111"when 83=>toneindex2<="0111"when 84=>toneindex2<="1001"when 85=>toneindex2<="1010"when 86=>toneindex2<="1011"when 87=>toneindex2<="1011"when 88=>toneindex2<="1100"when 89=>toneindex2<="1011"when 90=>toneindex2<="1010"when 91=>toneindex2<="1010"when 92=>toneindex2<="0000"when 93=>toneindex2<="0000"when 94=>toneindex2<="0010"when 95=>toneindex2<="0011"when 96=>toneindex2<="0100"when 97=>toneindex2<="0100"when 98=>toneindex2<="1010"when 99=>toneindex2<="1010"when 100=>toneindex2<="0111"when 101=>toneindex2<="0111"when 102=>toneindex2<="0010"when 103=>toneindex2<="0011"when 104=>toneindex2<="0100"when 105=>toneindex2<="0100"when 106=>toneindex2<="1010"when 107=>toneindex2<="1010"when 108=>toneindex2<="0111"when 109=>toneindex2<="0111"when 110=>toneindex2<="0111"when 111=>toneindex2<="0110"when 112=>toneindex2<="0101"when 113=>toneindex2<="0101"when 114=>toneindex2<="0101"when 115=>toneindex2<="0101"when 116=>toneindex2<="0110"when 117=>toneindex2<="0110"when 118=>toneindex2<="0111"when 119=>toneindex2<="0111"when 120=>toneindex2<="1010"when 121=>toneindex2<="1010"when 122=>toneindex2<="1010"when 123=>toneindex2<="1010"when 124=>toneindex2<="1010"when 125=>toneindex2<="1010"when 126=>toneindex2<="0101"when 127=>toneindex2<="0101"when 128=>toneindex2<="1001"when 129=>toneindex2<="1001"when 130=>toneindex2<="0000"when 131=>toneindex2<="0000"when 132=>toneindex2<="0000"when 133=>toneindex2<="0000"when 134=>toneindex2<="0000"when 135=>toneindex2<="0000"when 136=>toneindex2<="0000"when 137=>toneindex2<="0000"when 138=>toneindex2<="0000"when others=>null;end case;end process;end one;3.3.3按键tone模块程序library ieee;use ieee.std_logic_1164.all;entity tone isport(key:in std_logic_vector(6 downto 0);toneindex1:out std_logic_vector(3 downto 0);end;architecture one of tone isbeginsearch:process(key)begin case key iswhen"0000001"=>toneindex1<="0001"when"0000010"=>toneindex1<="0010"when"0000100"=>toneindex1<="0011"when"0001000"=>toneindex1<="0100"when"0010000"=>toneindex1<="0101"when"0100000"=>toneindex1<="0110"when"1000000"=>toneindex1<="0111"when others=>toneindex1<="0000"end case;end process;end;3.3.4tonetaba模块程序library ieee;use ieee.std_logic_1164.all; entity tonetaba is port ( index : in std_logic_vector(3 downto 0) ; code :out std_logic_vector(3 downto 0) ; high: out std_logic; tone :out std_logic_vector(10 downto 0) );end;architecture one of tonetaba isbeginprocess(index) begin case index is - 译码电路,查表方式,控制音调的预置数 when "0000" => tone<="11111111111" ; code<="0000" high<='0'- 2047 when "0001" => tone<="01100000101" ; code<="0001" high <='0'- 773; when "0010" => tone<="01110010000" ; code<="0010" high <='0'- 912; when "0011" => tone<="10000001100" ; code<="0011" high <='0'-1036; when "0100" => tone<="10001011100" ; code<="0100" high <='0'-1116; when "0101" => tone<="10010101101" ; code<="0101" high <='0'-1197; when "0110" => tone<="10100001010" ; code<="0110" high <='0'-1290; when "0111" => tone<="10101011100" ; code<="0111" high <='0'-1372; when "1000" => tone<="10110000010" ; code<="0001" high <='1'-1410; when "1001" => tone<="10111001000" ; code<="0010" high <='1'-1480; when "1010" => tone<="11000000110" ; code<="0011" high <='1'-1542; when "1100" => tone<="11001010110" ; code<="0101" high <='1'-1622; when "1101" => tone<="11010000100" ; code<="0110" high <='1'-1668; when "1111" => tone<="11011000000" ; code<="0001" high <='1'-1728; when others => null; end case; end process;end;3.3.5speaker模块程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity speakera isport ( clk :in std_logic; tone : in std_logic_vector(10 downto 0); spk : out std_logic);end;architecture one of speakera issignal preclk, fullspk :std_logic;beginprocess(clk)variable count4 :integer range 0 to 16 ;beginpreclk <= '0' - 将clk进行16分频,preclk为clk的16分频if count4=16 then preclk <= '1' count4 := 0;elsif clk'event and clk = '1' then count4 := count4 + 1; end if;end process;genspk: process(preclk, tone)- 11位可预置计数器variable count11 : std_logic_vector(10 downto 0);beginif preclk'event and preclk = '1' thenif count11 = "11111111111" then count11 := tone ;fullspk <= '1' else count11 := count11 + 1; fullspk<= '0' end if;end if;end process; process(fullspk)-将输出再2分频,展宽脉冲,使扬声器有足够功率发音 variable count2 : std_logic;beginif fullspk'event and fullspk= '1' then count2 := not count2;if count2 = '1' then spk<= '1'else spk<= '0' end if; end if;end process;end;3.3.6 顶层设计顶层keshe模块程序library ieee;use ieee.std_logic_1164.all;entity keshe isport(clk12:in std_logic;key:in std_logic_vector(6 downto 0);cs:in std_logic;code1:out std_logic_vector(3 downto 0);high1:out std_logic;spkout:out std_logic);end;architecture bhv of keshe iscomponent toneport(key:in std_logic_vector(6 downto 0);toneindex1:out std_logic_vector(3 downto 0);end component;component notetabsport( clk:in std_logic; toneindex2:out std_logic_vector(3 downto 0);end component;component bmuxport(index1:in std_logic_vector(3 downto 0);index2:in std_logic_vector(3 downto 0);cs :in std_logic;toneindex:out std_logic_vector(3 downto 0);end component;component tonetabaport ( index : in std_logic_vector(3 downto 0) ; code :out std_logic_vector(3 downto 0) ; high: out std_logic; tone :out std_logic_vector(10 downto 0) );end component;component speakeraport ( clk :in std_logic; tone : in std_logic_vector(10 downto 0); spk : out std_logic);end component;component fpq1port(clk12:in std_logic; clk1:buffer std_logic);end component;component fpq2port(clk1:in std_logic; clk2:buffer std_logic);end component;signal toneindex1:std_logic_vector(3 downto 0);signal toneindex2:std_logic_vector(3 downto 0);signal toneindex:std_logic_vector(3 downto 0);signal tone1:std_logic_vector(10 downto 0);signal clk:std_logic;signal clk1:std_logic;beginu0:fpq1 port map(clk12,clk);u1:fpq2 port map(clk,clk1);u2:tone port map(key,toneindex1);u3:notetabs port map(clk1,toneindex2);u4:bmux port map(toneindex1,toneindex2,cs,toneindex);u5:tonetaba port map(toneindex,code1,high1,tone1);u6:speakera port map(clk12,tone1,spkout);end;4编译、仿真、下载验证4.1编译过程1)建立顶层设计文件夹MYEDADZQ在硬盘适当位置建立MYEDADZQ文件夹中。注意:该文件夹的路径中不能包含汉字。路径中的所有目录和子目录的名称都必须符合VHDL的语法规则。2)子模块文件的设计打开QuartusII,新建五个.VHD文件,输入所有的子模块源程序后保存在MYEDADZQ文件夹下,并进行查错操作。3)顶层模块文件设计打开QuartusII,新建一个TOP.VHD文件,输入源程序后进行保存、查错、编译、功能和时序仿真等相关操作。4.2仿真结果由于本设计从功能和时序仿真图上来判断设计是否成功不太直观。最好的方法是完成下载验证通过实际电路验证,所以这里给出仿真结果有误差不是很符合实际效果。下面只给出顶层设计的时序仿真图,如图四所示(图四)4.3下载验证1)锁定引脚按照下表表一所示对应关系锁定引脚。表名称引脚名称引脚CLK8HZPIN_17KEY0PIN_1CLK12MHZPIN_92KEY1PIN_2CODE10PIN_39KEY2PIN_3CODE11PIN_40KEY3PIN_4CODE12PIN_41KEY4PIN_5CODE13PIN_42KEY5PIN_6CSPIN_10KEY6PIN_7HIGH1PIN_11SPKOUTPIN_1292)下载验证通过选择GW48EDA_PK3实验箱NO.3配置方案,按照前面所述的方法进行程序配置,然后进行验证演示5 总结通过这些日子的设计,终于完成了简易电子琴设计,该设计让我懂得了许多的东西,包括专业方面和学习方面的,在系统设计上面我知道了要设计一个电子系统是要经过许多步骤,包括硬件和软件方面的知识,在学习方面,她让我懂得了学习要扎实,一开始我很简单的认为只要把VHDL语言弄懂了就算是完成了一个电子系统的设计,到了后来验收时,我才发现我是错误的,这里面包括要对整个系统做到完全的把握,包括每一个步骤,还让我自学了用protell画一些简单的系统原理图,总之让我明白了很多的东西,在该设计的过程中,我得到了李岩老师的帮助和指导,在此感谢李岩老师。参考文献1 李国洪.沈明山.EDA技术与实践.机械工业出版社, 2004年7月2 沈明山.EDA技术及可编程器件应用实例.科学出版社,2004年10月3 赵明富.李立军.EDA技术基础.北京大学出版社,2007年6月4 江国强.EDA技术与应用.电子工业出版社,2007年4月5 百度百科.VHDL. 18

    注意事项

    本文(EDA课程设计论文简易乐器演奏器.doc)为本站会员(sccc)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开