乐曲硬件演奏电路设计Verilog代码Quartus DE1-SOC实验箱
名称:乐曲硬件演奏电路设计Verilog代码Quartus DE1-SOC实验箱
软件:Quartus
语言:Verilog
代码功能:
乐曲硬件演奏电路基本要求:使用数控分频器设计乐曲演奏电路
实验原理:组成乐曲的每个音符的发音频率值及其持续的时间是乐曲能连续演奏所需要的两个基本要素,问题是如何来获取这两个要素所对应的数值以及通过纯硬件的手段来利用这些数值实现乐曲的演奏效果。
本代码已在DE1-SOC实验箱验证,DE1-SOC实验箱如下,其他开发板可以修改管脚适配:

演示视频
1. 工程文件

编辑
2. 程序文件

编辑

编辑

编辑
3. 程序编译

编辑
4. RTL图

编辑
5. 管脚分配

编辑
6. 仿真图
cnt_1模块

编辑
decoder_1模块

编辑
Dvf模块

编辑
部分代码展示:
//初始值设置译码器 module decoder_1( input [3:0] index, output reg [3:0] code, output reg high, output reg [10:0] tone ); //decoder_1模块输出此音符相应的计数初值 always@(*) case(index) 4'd0:begin tone<=11'h7ff;code<=4'd0;high<=1'b0;end 4'd1:begin tone<=11'h305;code<=4'd1;high<=1'b0;end 4'd2:begin tone<=11'h390;code<=4'd2;high<=1'b0;end 4'd3:begin tone<=11'h40c;code<=4'd3;high<=1'b0;end 4'd4:begin tone<=11'h443;code<=4'd4;high<=1'b0;end 4'd5:begin tone<=11'h4ac;code<=4'd5;high<=1'b0;end 4'd6:begin tone<=11'h50a;code<=4'd6;high<=1'b0;end 4'd7:begin tone<=11'h55c;code<=4'd7;high<=1'b0;end 4'd8:begin tone<=11'h582;code<=4'd1;high<=1'b1;end 4'd9:begin tone<=11'h5c8;code<=4'd2;high<=1'b1;end 4'd10:begin tone<=11'h606;code<=4'd3;high<=1'b1;end 4'd11:begin tone<=11'h622;code<=4'd4;high<=1'b1;end 4'd12:begin tone<=11'h656;code<=4'd5;high<=1'b1;end 4'd13:begin tone<=11'h684;code<=4'd6;high<=1'b1;end 4'd14:begin tone<=11'h699;code<=4'd7;high<=1'b1;end 4'd15:begin tone<=11'h6c0;code<=4'd1;high<=1'b1;end default:begin tone<=11'h7ff;code<=4'd0;high<=1'b0;end endcase endmodule
代码下载(付费后下载)
![]()
1、代码文件需要付费后才可见。
2、支付问题请联系微信公众号客服。
3、优质Verilog/VHDL代码资源,所见即所得。
Verilog/VHDL资源下载 » 乐曲硬件演奏电路设计Verilog代码Quartus DE1-SOC实验箱
2、支付问题请联系微信公众号客服。
3、优质Verilog/VHDL代码资源,所见即所得。
Verilog/VHDL资源下载 » 乐曲硬件演奏电路设计Verilog代码Quartus DE1-SOC实验箱
发表评论
模板文件不存在: ./template/plugins/comment/pc/index.htm