文件名称:song
介绍说明--下载内容均来自于网络,请自行研究使用
module song(clk,key,song_out,led)
input [7:0] key
input clk
output song_out
output [7:0] led
reg song_reg
reg [21:0] count
reg [19:0] delay
reg [7:0] key_reg
always @(posedge clk)
begin
count=count+1
if((count==delay)&(!(delay==20 d65535)))
begin
count=22 d0
song_reg=!song_reg
end
end
always @(key)
begin
key_reg=key
case(key_reg)
8 b0000_0001: delay=20 d47774 //zhong yin 1 523.3HZ
8 b0000_0010: delay=20 d42568 //zhong yin 2 587.3HZ
8 b0000_0100: delay=20 d37919 //zhong yin 3 659.3HZ
8 b0000_1000: delay=20 d35791 //zhong yin 4 698.5HZ
8 b0001_0000: delay=20 d31888 //zhong yin 5 784HZ
8 b0010_0000: delay=20 d28409 //zhong yin 6 880HZ
8 b0100_0000: delay=20 d25309 //zhong yin 7 987.8HZ
8 b1000_0000: delay=20 d23889 //gao yin 1 1046.5HZ
default: delay=20 d65535
endcase
end
assign song_out=song_reg
文件: song.rar
大小: 357KB
下载: 下载
assign led=key_reg
endmodule
-module song (clk, key, song_out, led) input [7:0] key input clk output song_out output [7:0] led reg song_reg reg [21:0] count reg [19:0 ] delay reg [7:0] key_reg always @ (posedge clk) begin count = count+1 if ((count == delay )& (!( delay == 20' d65535))) begin count = 22 ' d0 song_reg =! song_reg end end always @ (key) begin key_reg = key case (key_reg) 8' b0000_0001: delay = 20' d47774 // zhong yin 1 523.3HZ 8' b0000_0010: delay = 20' d42568 // zhong yin 2 587.3HZ 8' b0000_0100: delay = 20' d37919 // zhong yin 3 659.3HZ 8' b0000_1000: delay = 20' d35791 // zhong yin 4 698.5HZ 8' b0001_0000: delay = 20' d31888 // zhong yin 5 784HZ 8' b0010_0000: delay = 20' d28409 // zhong yin 6 880HZ 8' b0100_0000: delay = 20' d25309 // zhong yin 7 987.8HZ 8' b1000_0000: delay = 20' d23889 // gao yin 1 1046.5HZ default: delay = 20' d65535 endcase end assign song_out = song_reg file: song.rar Size: 357KB Download: Download
input [7:0] key
input clk
output song_out
output [7:0] led
reg song_reg
reg [21:0] count
reg [19:0] delay
reg [7:0] key_reg
always @(posedge clk)
begin
count=count+1
if((count==delay)&(!(delay==20 d65535)))
begin
count=22 d0
song_reg=!song_reg
end
end
always @(key)
begin
key_reg=key
case(key_reg)
8 b0000_0001: delay=20 d47774 //zhong yin 1 523.3HZ
8 b0000_0010: delay=20 d42568 //zhong yin 2 587.3HZ
8 b0000_0100: delay=20 d37919 //zhong yin 3 659.3HZ
8 b0000_1000: delay=20 d35791 //zhong yin 4 698.5HZ
8 b0001_0000: delay=20 d31888 //zhong yin 5 784HZ
8 b0010_0000: delay=20 d28409 //zhong yin 6 880HZ
8 b0100_0000: delay=20 d25309 //zhong yin 7 987.8HZ
8 b1000_0000: delay=20 d23889 //gao yin 1 1046.5HZ
default: delay=20 d65535
endcase
end
assign song_out=song_reg
文件: song.rar
大小: 357KB
下载: 下载
assign led=key_reg
endmodule
-module song (clk, key, song_out, led) input [7:0] key input clk output song_out output [7:0] led reg song_reg reg [21:0] count reg [19:0 ] delay reg [7:0] key_reg always @ (posedge clk) begin count = count+1 if ((count == delay )& (!( delay == 20' d65535))) begin count = 22 ' d0 song_reg =! song_reg end end always @ (key) begin key_reg = key case (key_reg) 8' b0000_0001: delay = 20' d47774 // zhong yin 1 523.3HZ 8' b0000_0010: delay = 20' d42568 // zhong yin 2 587.3HZ 8' b0000_0100: delay = 20' d37919 // zhong yin 3 659.3HZ 8' b0000_1000: delay = 20' d35791 // zhong yin 4 698.5HZ 8' b0001_0000: delay = 20' d31888 // zhong yin 5 784HZ 8' b0010_0000: delay = 20' d28409 // zhong yin 6 880HZ 8' b0100_0000: delay = 20' d25309 // zhong yin 7 987.8HZ 8' b1000_0000: delay = 20' d23889 // gao yin 1 1046.5HZ default: delay = 20' d65535 endcase end assign song_out = song_reg file: song.rar Size: 357KB Download: Download
(系统自动生成,下载前可以参看下载内容)
下载文件列表
song\song.qpf
....\song.qsf
....\db\song.db_info
....\..\song.cmp0.ddb
....\..\song.fit.qmsg
....\..\song.cmp.rdb
....\..\song.cmp.ecobp
....\..\song.cmp_bb.logdb
....\..\song.asm.qmsg
....\..\song.cbx.xml
....\..\prev_cmp_song.map.qmsg
....\..\prev_cmp_song.fit.qmsg
....\..\song.rtlv.hdb
....\..\song.cmp.hdb
....\..\song.pre_map.hdb
....\..\song.tan.qmsg
....\..\prev_cmp_song.asm.qmsg
....\..\song.rtlv_sg_swap.cdb
....\..\prev_cmp_song.tan.qmsg
....\..\song.pre_map.cdb
....\..\song.sld_design_entry.sci
....\..\prev_cmp_song.qmsg
....\..\song.map.qmsg
....\..\song.map_bb.logdb
....\..\song.eco.cdb
....\..\song.sgdiff.cdb
....\..\song.sgdiff.hdb
....\..\song.sld_design_entry_dsc.sci
....\..\song.cmp.logdb
....\..\song.asm_labs.ddb
....\..\song.rtlv_sg.cdb
....\..\song.map_bb.cdb
....\..\song.map_bb.hdb
....\..\song.map.logdb
....\..\song.map.cdb
....\..\song.map.hdb
....\..\song.map.bpm
....\..\song.cmp.cdb
....\..\song.hif
....\..\song.cmp.tdb
....\..\song.cmp_bb.hdb
....\..\song.hier_info
....\..\song.tis_db_list.ddb
....\..\song.cmp_bb.cdb
....\..\song.cmp.bpm
....\..\song.psp
....\..\song.dbp
....\..\song.pss
....\..\song.signalprobe.cdb
....\..\song.syn_hier_info
....\..\song.map.ecobp
....\..\song.cmp_bb.rcf
....\song.map.summary
....\song.pin
....\song.fit.smsg
....\song.fit.summary
....\song.sof
....\song.pof
....\song.tan.summary
....\song.done
....\song.dpf
....\song.v.bak
....\song.v
....\song.map.rpt
....\song.fit.rpt
....\song.asm.rpt
....\song.tan.rpt
....\song.flow.rpt
....\db
song
....\song.qsf
....\db\song.db_info
....\..\song.cmp0.ddb
....\..\song.fit.qmsg
....\..\song.cmp.rdb
....\..\song.cmp.ecobp
....\..\song.cmp_bb.logdb
....\..\song.asm.qmsg
....\..\song.cbx.xml
....\..\prev_cmp_song.map.qmsg
....\..\prev_cmp_song.fit.qmsg
....\..\song.rtlv.hdb
....\..\song.cmp.hdb
....\..\song.pre_map.hdb
....\..\song.tan.qmsg
....\..\prev_cmp_song.asm.qmsg
....\..\song.rtlv_sg_swap.cdb
....\..\prev_cmp_song.tan.qmsg
....\..\song.pre_map.cdb
....\..\song.sld_design_entry.sci
....\..\prev_cmp_song.qmsg
....\..\song.map.qmsg
....\..\song.map_bb.logdb
....\..\song.eco.cdb
....\..\song.sgdiff.cdb
....\..\song.sgdiff.hdb
....\..\song.sld_design_entry_dsc.sci
....\..\song.cmp.logdb
....\..\song.asm_labs.ddb
....\..\song.rtlv_sg.cdb
....\..\song.map_bb.cdb
....\..\song.map_bb.hdb
....\..\song.map.logdb
....\..\song.map.cdb
....\..\song.map.hdb
....\..\song.map.bpm
....\..\song.cmp.cdb
....\..\song.hif
....\..\song.cmp.tdb
....\..\song.cmp_bb.hdb
....\..\song.hier_info
....\..\song.tis_db_list.ddb
....\..\song.cmp_bb.cdb
....\..\song.cmp.bpm
....\..\song.psp
....\..\song.dbp
....\..\song.pss
....\..\song.signalprobe.cdb
....\..\song.syn_hier_info
....\..\song.map.ecobp
....\..\song.cmp_bb.rcf
....\song.map.summary
....\song.pin
....\song.fit.smsg
....\song.fit.summary
....\song.sof
....\song.pof
....\song.tan.summary
....\song.done
....\song.dpf
....\song.v.bak
....\song.v
....\song.map.rpt
....\song.fit.rpt
....\song.asm.rpt
....\song.tan.rpt
....\song.flow.rpt
....\db
song