Vivado DDS
来源:互联网 发布:js array splice无参数 编辑:程序博客网 时间:2024/04/30 20:56
1.Matlab生成coe文件
t=0:2*pi/2^12:2*pi y=0.5*sin(t)+0.5; r=ceil(y*(2^8-1)); %将小数转换为整数,ceil是向上取整。 fid = fopen('sin.coe','w'); %写到sin.coe文件,用来初始化sin_rom
2.DDS原理
F1=F0∗K/2N
F0 是CLK频率,F1 是DDS产生的信号频率。
3.verilog代码如下
`timescale 1ns / 1psmodule nco( input mclk, input rst_n, input [31:0]fword,//frequency control input [11:0]pword,//phase control output [9:0]da_data ); reg [31:0]r_fword=32'd0; reg [11:0]r_pword=12'd0; reg [31:0]fcnt=32'd0; wire [11:0]addr_rom; //同步寄存器 always @(posedge mclk) begin r_fword <= fword; r_pword <= pword; end always @(posedge mclk or posedge rst_n) begin if(!rst_n) fcnt <= 32'd0; else fcnt <= fcnt + r_fword; end // 取高11位相当于除以4096 assign addr_rom = fcnt[31:20] + r_pword; //custom sin_rom blk_mem_gen_0 sin_rom ( .clka(mclk), // input wire clka .addra(addr_rom), // input wire [11 : 0] addra .douta(da_data) // output wire [9 : 0] douta );endmodule
4.Simulation
`timescale 1ns / 1psmodule nco( input mclk, input rst_n, input [31:0]fword,//frequency control input [11:0]pword,//phase control output [9:0]da_data ); reg [31:0]r_fword=32'd0; reg [11:0]r_pword=12'd0; reg [31:0]fcnt=32'd0; wire [11:0]addr_rom; //同步寄存器 always @(posedge mclk) begin r_fword <= fword; r_pword <= pword; end always @(posedge mclk or posedge rst_n) begin if(!rst_n) fcnt <= 32'd0; else fcnt <= fcnt + r_fword; end // 取高11位相当于除以4096 assign addr_rom = fcnt[31:20] + r_pword; //custom sin_rom blk_mem_gen_0 sin_rom ( .clka(mclk), // input wire clka .addra(addr_rom), // input wire [11 : 0] addra .douta(da_data) // output wire [9 : 0] douta );endmodule
阅读全文
0 0
- Vivado DDS
- dds
- DDS
- dds
- DDS
- DDS
- Vivado中仿真DDS核注意事项即仿真IP核时需要注意的事项
- vivado
- DDS 文件
- DDS 文件格式
- RTI DDS
- 关于DDS
- DDS程序
- DDS格式
- dds纹理
- DDS文件格式
- DDS作业
- DDS作业
- [小程序开发] 腾讯云主机配置mysql ,第一步
- 关于CLLocation定位中CLGeocoder报错的问题
- php静态方法
- 上滑 显示底部 下滑 隐藏顶部 协调者布局
- asu修改序列号(IBM X86服务器)
- Vivado DDS
- inux命令大全完整版
- jdk 1.8 hashmap源码解读(详细)(上)
- 项目问题-解决mysql插入中文乱码以及程序中插入中文报错问题
- 使用原生js和jQuery实现表格的隔行变色
- javascript中的for in循环和for循环的使用
- ajax有无contentType: "application/json"的区别
- 构建和运行您的应用
- android.intent.action.BOOT_COMPLETED 被延迟接收问题