基于FPGA的MSK调制波形Verilog代码Quartus仿真

名称:基于FPGA的MSK调制波形Verilog代码Quartus仿真(文末获取)

软件:Quartus

语言:Verilog

代码功能:

基于FPGA的MSK调制波形

1、输入调制原始数据,输出MSK调制波形

2、包括差分编码模块,MSK调制模块,DDS模块,有符号乘法器模块等

1. 工程文件

2. 程序文件

3. 程序编译

4. RTL图

5. Testbench

6. 仿真图

差分编码模块

MSK调制模块

DDS模块

有符号乘法器模块

部分代码展示:

// megafunction wizard: %NCO v12.1%
// GENERATION: XML
// ============================================================
// Megafunction Name(s):
// dds_st
// ============================================================
// Generated by NCO 12.1 [Altera, IP Toolbench 1.3.0 Build 177]
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
// ************************************************************
// Copyright (C) 1991-2014 Altera Corporation
// Any megafunction design, and related net list (encrypted or decrypted),
// support information, device programming or simulation file, and any other
// associated documentation or information provided by Altera or a partner
// under Altera's Megafunction Partnership Program may be used only to
// program PLD devices (but not masked PLD devices) from Altera.  Any other
// use of such megafunction design, net list, support information, device
// programming or simulation file, or any other related documentation or
// information is prohibited for any other purpose, including, but not
// limited to modification, reverse engineering, de-compiling, or use with
// any other silicon devices, unless such use is explicitly licensed under
// a separate agreement with Altera or a megafunction partner.  Title to
// the intellectual property, including patents, copyrights, trademarks,
// trade secrets, or maskworks, embodied in any such megafunction design,
// net list, support information, device programming or simulation file, or
// any other related documentation or information provided by Altera or a
// megafunction partner, remains with Altera, the megafunction partner, or
// their respective licensors.  No other licenses, including any licenses
// needed under any third party's intellectual property, are provided herein.
module dds (
phi_inc_i,
clk,
reset_n,
clken,
freq_mod_i,
fsin_o,
fcos_o,
out_valid);
input[24:0]phi_inc_i;
inputclk;
inputreset_n;
inputclken;
input[24:0]freq_mod_i;
output[14:0]fsin_o;
output[14:0]fcos_o;
outputout_valid;
dds_stdds_st_inst(
.phi_inc_i(phi_inc_i),
.clk(clk),
.reset_n(reset_n),
.clken(clken),
.freq_mod_i(freq_mod_i),
.fsin_o(fsin_o),
.fcos_o(fcos_o),
.out_valid(out_valid));
endmodule

源代码

 扫描文章末尾的公众号二维码

  • 24
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
以下是一个简单的MSK调制解调的Quartus II仿真代码,其中使用了Verilog HDL: ```verilog module msk_mod_demod( input clk, input rst, input data_in, output reg data_out ); reg [7:0] counter; reg [7:0] phase; reg [7:0] prev_phase; reg [7:0] diff_phase; parameter FREQ_DEV = 32; parameter BAUD_RATE = 1000; parameter SAMPLE_RATE = 8000; assign data_out = (diff_phase > 0); always @(posedge clk or posedge rst) begin if (rst) begin counter <= 0; phase <= 0; prev_phase <= 0; diff_phase <= 0; end else begin counter <= counter + 1; if (counter >= SAMPLE_RATE / BAUD_RATE) begin counter <= 0; phase <= phase + FREQ_DEV; end prev_phase <= phase; end end always @(posedge clk or posedge rst) begin if (rst) begin data_out <= 0; end else begin diff_phase <= phase - prev_phase; end end endmodule ``` 在此代码中,我们定义了一个名为“msk_mod_demod”的模块,它有四个输入和输出端口。输入端口包括时钟信号“clk”、复位信号“rst”和数据信号“data_in”。输出端口为数据信号“data_out”。 调制和解调的逻辑都在“always”块中实现。“msk_mod_demod”模块使用一个计数器来计算数据位之间的时间间隔,以及当前的相位角。如果相位角与上一个时刻的相位角之差为正,则输出1;否则输出0。 该代码使用了三个参数:频率偏移“FREQ_DEV”、波特率“BAUD_RATE”和采样率“SAMPLE_RATE”。这些参数可以根据需要进行更改。 请注意,这只是一个简单的示例代码,可能需要根据实际需求进行修改。同时,仿真测试时需要进行适当的测试矢量生成,以确保代码的正确性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值