基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx

上传人:b****6 文档编号:21638480 上传时间:2023-01-31 格式:DOCX 页数:15 大小:140.05KB
下载 相关 举报
基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx_第1页
第1页 / 共15页
基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx_第2页
第2页 / 共15页
基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx_第3页
第3页 / 共15页
基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx_第4页
第4页 / 共15页
基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx

《基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx》由会员分享,可在线阅读,更多相关《基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx(15页珍藏版)》请在冰豆网上搜索。

基于verilog语言简易电子琴设计 数字电子技术课程设计报告Word格式.docx

四、管脚对应表

说明对应信号名称FPGA管脚名L21MHz基准时钟F3OU音频输出F8S1A14S2F10S3B16S基本功能按F1SB1SF1SB1SMBTMBT扩展功能按U1BTU1BT4五、实验过程、设计按键防抖模块1)设计程序1(。

modulexiaodou(rst,clk_1M,out).

inputclk_1M。

inputrst。

outputout。

wirerst

regout。

reg[24:

0]cnt。

reg[2:

0]stateparameterstate0=3'

b000,

state1=3'

b001,

state2=3'

b010,

state3=3'

b011,

state4=3'

b100,

state5=3'

b101

always@(posedgeclk_1M)

begin

cnt<

=24'

d0case(state)

state0:

if(!

rst)

out=0。

state<

=state1end

else

=state0state1:

begin

=cnt+1if(cnt==10000)

=state2else

//out=1。

end

state2:

=state3else

=state0state3:

out=1。

=0。

//state<

=state3end

state<

=state4

state4:

=cnt+1if(cnt==200000)

out=1

=state5end

else

=state4end

state5:

if(rst)

=state0end

=state3

endcaseend

endmodule)原理图及仿真波形(2

、按键识别模块设计2)程序设计1(.

modulexkey(a,b,c,d,e,f,g,h,l,qout)。

inputa,b,c,d,e,f,g,h,l。

outputqout。

reg[8:

0]qin。

reg[4:

0]qoutalways@(aorborcordoreorforgorhorl)begin。

qin[8]=a。

qin[7]=b。

qin[6]=c。

qin[5]=d。

qin[4]=e。

qin[3]=f。

qin[2]=g。

qin[1]=h。

qin[0]=lendalways@(qin)begincase(qin)。

9'

b100000000:

qout<

=5'

b00001。

b010000000:

b00010。

b001000000:

b00011。

b000100000:

b00100。

b000010000:

b00101。

b000001000:

b00110。

b000000100:

b00111。

b100000010:

b01000。

b010000010:

b01001。

b001000010:

b01010.

b000100010:

b01011。

b000010010:

b01100。

b000001010:

b01101。

b000000110:

b01110。

b100000001:

b01111。

b010000001:

b10000。

b001000001:

b10001。

b000100001:

b10010。

b000010001:

b10011。

b000001001:

b10100。

b000000101:

b10101。

b000000000:

b00000。

b000000010:

b000000001:

default:

=0endcaseendendmodule)原理图及仿真波形2(

、分频器模块地设计3)程序设计1(。

modulefenpin(in,clk_1M,out)。

inputin。

inputclk_1M。

outputout。

wire[4:

0]in。

reg[11:

0]count。

reg[4:

0]stateinitial。

count<

=12'

d0parameterstate0=5'

b00000,

state1=5'

b00001,

state2=5'

b00010,

state3=5'

b00011,

state4=5'

b00100,

state5=5'

b00101,

state6=5'

b00110,

state7=5'

b00111,

state8=5'

b01000,

state9=5'

b01001,

state10=5'

b01010,

state11=5'

b01011,

state12=5'

b01100,

state13=5'

b01101,

state14=5'

b01110,

state15=5'

b01111,

state16=5'

b10000,

state17=5'

b10001,

state18=5'

b10010,

state19=5'

b10011,

state20=5'

b10100,

state21=5'

b10101,

state22=5'

b10110

always@(posedgeclk_1M)begincase(state)

state0:

//if(allin==5'

b10110)

=state0if(in==5'

b00001)

=state1elseif(in==5'

b00010)

=state2

elseif(in==5'

b00011)

=state3elseif(in==5'

b00100)

b00101)

=state5elseif(in==5'

b00110)

=state6

b00111)

=state7elseif(in==5'

b01000)

=state8elseif(in==5'

b01001)

=state9elseif(in==5'

b01010)

=state10elseif(in==5'

b01011)

=state11elseif(in==5'

b01100)

=state12elseif(in==5'

b01101)

=state13elseif(in==5'

b01110)

=state14

b01111)

=state15elseif(in==5'

b10000)

=state16elseif(in==5'

b10001)

=state17elseif(in==5'

b10010)

=state18elseif(in==5'

b10011)

=state19

b10100)

=state20elseif(in==5'

b10101)

=state21elseif(in==5'

b00000)

=state22

=state0

state1:

if(count<

=956)

count=count+12'

d1end

if(in==5'

=state1else

out=0

out=~out

count=0

if(count<

=852)begin

count=count+12'

d1。

end

state2:

if(in==5'

b00010)state<

=state2。

elsebeginout=0。

=state0。

endend

elsebeginbeginout=~out。

count=0。

endif(in==5'

elsebegin

out=0。

endendend

state3:

=759)begin

b00011)state<

=state3。

state4:

=716)begin

b00100)state<

=state4。

state5:

=638)begin

b00101)state<

=state5。

state6:

=568)begin

b00110)state<

=state6。

d1begin

=501)begin

state7:

b00111)state<

=state7。

state8:

=478)begin

b01000)state<

=state8。

state9:

=426)begin

b01001)state<

=state9。

state10:

=380)begin

b01010)state<

=state10。

state11:

=358)begin

b01011)state<

=state11。

state12:

=319)begin

b01100)state<

=state12。

state13:

=284)begin

b01101)state<

=state13。

state14:

=251)begin

b01110)state<

=state14。

else。

=state14end。

out=~outbeginbeginelse

state15:

=1912)begin

b01111)state<

=state15。

state16:

=1704)begin

b10000)state<

=state16。

state17:

=1518)begin

b10001)state<

=state17。

state18:

=1432)begin

b10010)state<

=state18。

state19:

=1276)begin

b10011)state<

=state19。

state20:

=1136)begin

b101

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育 > 少儿英语

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1