ImageVerifierCode 换一换
格式:DOC , 页数:29 ,大小:200.54KB ,
资源ID:2727091      下载积分:10 金币
验证码下载
登录下载
邮箱/手机:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/2727091.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  
声明  |  会员权益     获赠5币     写作写作

1、填表:    下载求助     留言反馈    退款申请
2、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
3、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
4、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
5、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【快乐****生活】。
6、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
7、本文档遇到问题,请及时私信或留言给本站上传会员【快乐****生活】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。

注意事项

本文(veriloghdl电子琴专业课程设计.doc)为本站上传会员【快乐****生活】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4008-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

veriloghdl电子琴专业课程设计.doc

1、湖北文理学院课程设计汇报 题 目 Verilog hdl课程设计专 业 1211自动化 学生姓名 一天虹影 指导老师 单鸣雷 完成时间 19 课程设计(汇报)任务书(理 工 科 类)课程设计(汇报)题目:电子琴设计课程设计(论文)工作内容一、课程设计目标 1、培养综合利用知识和独立开展实践创新能力;2、深入学习Verilog HDL,了解其编程环境;3、学会利用Modelsim和Quartus II等编程仿真软件;4、将硬件语言编程和硬件实物功效演示相结合,加深了解Verilog HDL学习;二、研究方法及手段应用1、将任务分成若干模块,查阅相关论文资料,分模块调试和完成任务;2、碰到问题小组

2、组员立即讨论得出处理方法;3、碰到本组内处理不了问题,立即和其它小组交流或问询老师;4、程序仿真,仿真无问题后进行模块调试,依据试验箱上硬件实现是否符合要求来检验程序正确是否。三、课程设计预期效果1、完成试验环境搭建;2、含有手动弹奏和自动播放功效;3、以按键(或开关)作为琴键,最少能够经过蜂鸣器输出7个音阶;4、自动播放曲目最少两首; 摘 要简易电子琴设计经过经过软硬件结合实现,硬件系统包含主控器芯片、9个按键、LED、蜂鸣器等,软件资源包含编写Verilog HDL程序应用软件Modelsim和仿真软件Quartus II。电子琴有按键替换琴键弹奏功效和自动播放功效。按键有七个音,自动播放

3、功效中有三首曲子,分别是两只老虎、天空之城和康定情歌。程序共有五个模块,分别为主模块、琴键模块、曲1模块、曲2模块、曲3模块。硬件实现是用三个LED灯组合亮暗分别表示七个按键按下情况,另外两个按键用来选择曲目。试验箱原始时钟为50MHz,分频后变成不一样频率输出,经过蜂鸣器输出不一样频率声音。音乐节拍经过分频变为4Hz,作为1/4拍。经过主模块调用各模块实现电子琴功效。【关键词】Verilog HDL 电子琴 模块 分频ABSTRACTThis article introduced the simple electric pianos design. It realizes through t

4、he software and hardware union. The hardware system includes a director, 9 keys, LEDs and a buzzer. The software design uses Verilog HDL. Emulation uses Quartus II. It can broadcast the system establishment the corresponding note, and can complete a military song the broadcast, but also has shows th

5、e sound the function. Designs the simple electric piano to have in the hardware. The program has seven modules, including main module, fractional frequency module and so on. Keyboard with keys to play the function and replace the keys to play function. Key has seven sound, automatic playback functio

6、n with three in song, were the two tiger , the sky city and kangding love songs. Software has its merit. It is perfect in the software Verilog HDL. The original frequency is divided into different frequencys. The piano makes sound by the buzzer with different frequencys.【keywords】Verilog HDL electri

7、c piano module fractional frequency第一章 系统设计第一节 课题目标及总体方案此次项目设计课程目标是让我们在学习Verilog HDL基础上愈加深入了解硬件设计语言功效、作用及其特征,而且将我们动手能力和创新能力结合起来。此次电子琴试验目标是:1、含有手动弹奏和自动播放功效;2、以按键(或开关)作为琴键,最少能够经过蜂鸣器输出7个音阶;3、自动播放曲目最少两首;此次试验方框图为:(每个模块中全部有分频)主模块九个键Key1到Key7用于弹奏Key8和Key9(mm)用于选择歌曲mm=00按键模块Key1到Key7模块名digital_pianomm=01曲目1

8、两只老虎模块名 bellmm=10曲目2康定情歌模块名 bell2mm=11曲目3天空之城模块名 bell3第二节 设计框图说明 一、 主模块主模块中用mm=(key8,key9)值不一样选择调用不一样模块,mm=01调用曲目1模块,即bell模块;mm=10调用曲目2模块,即bell2模块;mm=11调用曲目3模块,即bell3模块;而在key8和key9没有被按下情况下,程序调用按键模块,即digital_piano模块module main(inclk,outclk,key1,key2,key3,key4,key5,key6,key7,key8,key9,num);input inclk

9、;input key1,key2,key3,key4,key5,key6,key7,key8,key9;output outclk;output3:0num;reg outclk,clk_6M;reg 3:0c;wire out1,out2,out3,out4;wire8:0 key;reg 1:0mm;assign key = key1,key2,key3,key4,key5,key6,key7,key8,key9; /由按键拼键为变量key /调用子调块digital_piano m1(.inclk(inclk),.key1(key1),.key2(key2),.key3(key3),.k

10、ey4(key4), .key5(key5),.key6(key6),.key7(key7),.beep2(out2),.num(num); bell m2(.inclk(inclk),.beep1(out1);bell2 m3(.inclk(inclk),.beep3(out3);bell3 m4(.inclk(inclk),.beep4(out4);always (posedge clk_6M) /在时钟上升沿检测是否有按键按下beginif(key = 9b)mm = 2b01;else if(key=9b)mm = 2b10;else if(key=9b)mm = 2b11;else

11、mm = 2b00;end always(posedge inclk) begin if(c4d4) c=c+4d1; else begin c=4d0; clk_6M=clk_6M; endend always (posedge clk_6M) beginif(mm = 2b01)outclk = out1;else if(mm = 2b00)outclk = out2;else if(mm = 2b10)outclk = out3;else outclk = out4;endendmodule二、按键模块Key1到key7对应do到si七个音,用于模拟电子琴弹奏/digital_piano

12、子模块module digital_piano(inclk,key1,key2,key3,key4,key5,key6,key7,beep2,num);input inclk,key1,key2,key3,key4,key5,key6,key7;output3:0num;output beep2; wire 6:0 key_code;reg 3:0c;reg clk_6M; reg beep_r;reg 3:0num;reg 15:0 count;reg 15:0 count_end;parameter Do = 7b1111110, /状态机7个编码,分别对应中音7个音符 re = 7b11

13、11101, mi = 7b1111011, fa = 7b1110111, so = 7b1101111, la = 7b1011111, si = 7b0111111;assign key_code = key7,key6,key5,key4,key3,key2,key1;assign beep2 = beep_r; /输出音乐always(posedge inclk) begin if(c4d4) c=c+4d1; else begin c=4d0; clk_6M=clk_6M; endendalways(posedge clk_6M) /分频模块,得出乐谱begincount = co

14、unt + 16d1; /计数器加1if(count = count_end)begincount =16d0; /计数器清零beep_r = !beep_r; endendalways(posedge clk_6M) /状态机,依据按键状态,选择不一样音符输出begincase(key_code)Do: count_end = 16d11450;re: count_end = 16d10204;mi: count_end = 16d09090;fa: count_end = 16d08571;so: count_end = 16d07802;la: count_end = 16d06802;

15、si: count_end = 16d06060;default:count_end = 16d0;endcaseend always (posedge clk_6M)begincase(key_code)Do: num=4b0001;re:num=4b0010;mi: num=4b0011;fa: num=4b0100;so: num=4b0101;la: num=4b0110;si: num=4b0111;endcaseendendmodule二、 曲目1模块/bell子模块 两只老虎module bell (inclk,beep1);input inclk; /系统时钟output be

16、ep1; /蜂鸣器输出端reg 3:0high,med,low;reg 15:0origin;reg beep_r; /寄存器reg 7:0state; reg 15:0count;assign beep1=beep_r; /输出音乐/时钟频率6MHzreg clk_6MHz;reg 2:0 cnt1; always(posedge inclk)begin if(cnt13d4) cnt1=cnt1+3b1; else begin cnt1=3b0; clk_6MHz=clk_6MHz; endend/时钟频率4MHzreg clk_4Hz;reg 24:0 cnt2; always(pose

17、dge inclk)begin if(cnt225d6250000) cnt2=cnt2+25b1; else begin cnt2=25b0; clk_4Hz=clk_4Hz; endendalways (posedge clk_6MHz)begincount = count + 1b1; /计数器加1if(count = origin)begincount = 16h0; /计数器清零beep_r = !beep_r; /输出取反endendalways(posedge clk_4Hz)begincase(high,med,low)12b:origin=11466;/mid112b:ori

18、gin=10216;/mid212b:origin=9101;/mid312b:origin=8590;/mid412b:origin=7653;/mid512b:origin=6818;/mid612b:origin=14447;/low5endcaseendalways (posedge clk_4Hz)/歌曲beginif(state =63) state = 0;/计时,以实现循环演奏elsestate = state + 1;case(state)0,1: high,med,low=12b;/mid12,3:high,med,low=12b;/mid24,5:high,med,low

19、=12b;/mid36,7:high,med,low=12b;/mid18,9: high,med,low=12b;/mid110,11:high,med,low=12b;/mid212,13:high,med,low=12b;/mid314,15:high,med,low=12b;/mid116,17:high,med,low=12b;/mid318,19: high,med,low=12b;/mid420,21,22,23: high,med,low=12b;/mid524,25:high,med,low=12b;/mid326,27: high,med,low=12b;/mid428,2

20、9,30,31: high,med,low=12b;/mid532:high,med,low=12b;/mid533: high,med,low=12b;/mid634:high,med,low=12b;/mid535:high,med,low=12b;/mid436,37:high,med,low=12b;/mid338,39:high,med,low=12b;/mid140:high,med,low=12b;/mid541: high,med,low=12b;/mid642:high,med,low=12b;/mid543:high,med,low=12b;/mid444,45:high,

21、med,low=12b;/mid346,47:high,med,low=12b;/mid148,49:high,med,low=12b;/mid250,51:high,med,low=12b;/low552,53,54,55:high,med,low=12b;/mid156,56:high,med,low=12b;/mid257,58:high,med,low=12b;/low559,60,61,62,63:high,med,low=12b;/mid1default : high,med,low=12bx;endcaseendendmodule三、 曲目2模块/bell2子模块康定情歌modu

22、le bell2 (inclk,beep3);input inclk; /系统时钟output beep3; /蜂鸣器输出端reg 3:0high,med,low;reg 15:0origin;reg beep_r; /寄存器reg 7:0state; reg 15:0count;assign beep3=beep_r; /输出音乐/时钟频率6MHzreg clk_6MHz;reg 2:0 cnt1; always(posedge inclk)begin if(cnt13d4) cnt1=cnt1+3b1; else begin cnt1=3b0; clk_6MHz=clk_6MHz; end

23、end/时钟频率4MHzreg clk_4Hz;reg 24:0 cnt2; always(posedge inclk)begin if(cnt225d6250000) cnt2=cnt2+25b1; else begin cnt2=25b0; clk_4Hz=clk_4Hz; endendalways (posedge clk_6MHz)begincount = count + 1b1; /计数器加1if(count = origin)begincount = 16h0; /计数器清零beep_r = !beep_r; /输出取反endendalways(posedge clk_4Hz)be

24、gincase(high,med,low) b:origin=22900; /低1 b:origin=20408; /低2 b:origin=18181; /低3 b:origin=15267; /低5b:origin=13605; /低6b:origin=11472; /中1b:origin=10216; /中2b:origin=9101; /中3b:origin=7653; /中5b:origin=6818; /中6b:origin=5733; /高1b:origin=5108; /高2b:origin=4551; /高3endcaseendalways (posedge clk_4Hz)

25、beginif(state =103) state = 0;elsestate = state + 1; /康定情歌case(state)0,1: high,med,low=b;/中32,3: high,med,low=b;/中54,5: high,med,low=b;/中66: high,med,low=b;/中67: high,med,low=b;/中58,9,10: high,med,low=b;/中611: high,med,low=b;/中312,13,14,15: high,med,low=b;/中216,17: high,med,low=b;/中318,19: high,med,

26、low=b;/中520,21: high,med,low=b;/中622: high,med,low=b;/中623: high,med,low=b;/中524,25: high,med,low=b;/中626,27,28,29,30,31:high,med,low=b;/中332,33: high,med,low=b;/中334,35: high,med,low=b;/中536,37: high,med,low=b;/中638: high,med,low=b;/中639: high,med,low=b;/中540,41,42: high,med,low=b;/中643: high,med,l

27、ow=b;/中344,45,46,47: high,med,low=b;/中248,49: high,med,low=b;/中550,51: high,med,low=b;/中352: high,med,low=b;/中253: high,med,low=b;/中354: high,med,low=b;/中255: high,med,low=b;/156,57: high,med,low=b;/中258,59,60,61,62,63:high,med,low=b;/低664,65: high,med,low=b;/中6 66,67,68,69,70,71:high,med,low=b;/中27

28、2,73: high,med,low=b;/中574,75,76,77,78,79:high,med,low=b;/中380: high,med,low=b;/中281: high,med,low=b;/182,83,84,85,86,87:high,med,low=b;/中688,89: high,med,low=b;/中590,91: high,med,low=b;/中392: high,med,low=b;/中293: high,med,low=b;/中394: high,med,low=b;/中295: high,med,low=b;/196,97: high,med,low=b;/中

29、298,99,100,101,102,103:high,med,low=b;/中6endcaseendendmodule四、 曲目3模块/bell3子模块天空之城module bell3 (inclk,beep4);input inclk; /系统时钟output beep4; /蜂鸣器输出端reg 3:0high,med,low;reg 15:0origin;reg beep_r; /寄存器reg 7:0state; reg 15:0count;assign beep4=beep_r; /输出音乐/时钟频率6MHzreg clk_6MHz;reg 2:0 cnt1; always(posed

30、ge inclk)begin if(cnt13d4) cnt1=cnt1+3b1; else begin cnt1=3b0; clk_6MHz=clk_6MHz; endend/时钟频率4MHzreg clk_4Hz;reg 24:0 cnt2; always(posedge inclk)begin if(cnt225d6250000) cnt2=cnt2+25b1; else begin cnt2=25b0; clk_4Hz=clk_4Hz; endendalways (posedge clk_6MHz)begincount = count + 1b1; /计数器加1if(count = o

31、rigin)begincount = 16h0; /计数器清零beep_r = !beep_r; /输出取反endendalways(posedge clk_4Hz)begincase(high,med,low) b:origin=22900; /低1 b:origin=20408; /低2 b:origin=18181; /低3 b:origin=17142; /低4b:origin=15267; /低5b:origin=13605; /低6b:origin=12121; /低7b:origin=11472; /中1b:origin=10216; /中2b:origin=9101; /中3b

32、:origin=8571; /中4b:origin=7653; /中5b:origin=6818; /中6b:origin=6060; /中7b:origin=5733; /高1b:origin=5108; /高2b:origin=4551; /高3b:origin=4294; /高4b:origin=3826; /高5b:origin=3409; /高6b:origin=3050; /高7endcaseendalways (posedge clk_4Hz)beginif(state =195)state = 0;elsestate = state + 1; /kang ding qing g

33、ecase(state)0:high,med,low=b;/中61: high,med,low=b;/中72,3,4:high,med,low=b;/高15:high,med,low=b;/中76,7: high,med,low=b;/高18,9:high,med,low=b;/高310,11,12,13,14,15: high,med,low=b;/中716,17: high,med,low=b;/中318,19,20:high,med,low=b;/中621: high,med,low=b;/中522,23: high,med,low=b;/中624,25:high,med,low=b;/

34、中126,27,28,29,30,31: high,med,low=b;/中5 32: high,med,low=b;/中333: high,med,low=b;/中334,35,36:high,med,low=b;/中437: high,med,low=b;/中338: high,med,low=b;/中439,40,41:high,med,low=b;/高142,43,44: high,med,low=b;/中345,46,47:high,med,low=b;/高148,49,50:high,med,low=b;/中751,52,53: high,med,low=b;/中454,55,56

35、,57,58,59,60,61: high,med,low=b;/中762:high,med,low=b;/中663: high,med,low=b;/中764,65,66:high,med,low=b;/高167:high,med,low=b;/高768,69:high,med,low=b;/高170,71:high,med,low=b;/高372,73,74:high,med,low=b;/中775,76:high,med,low=b;/中3 77,78,79: high,med,low=b;/中680:high,med,low=b;/中581,82:high,med,low=b;/中683,84: high,med,low=b;/中185,86,87,88,89,90: high,m

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服