VIVADO hls生成dds 波形 ddsIP核

想系统的学习hls加速开发fpga,接下来会更新实战项目工程
如下时钟100MHz,频率控制字429,496,729.6。生成16位的10MHz正弦波信号。

在这里插入图片描述在这里插入图片描述

void basicwave(ap_int<16> *sin, ap_int<16> *cos){#pragma HLS PIPELINE II=1 ap_int<16> cos_table[256] = {32768,32758,32728,32679,32610,32521,32413,32285,32138,31971,31785,31581,31357, 31114,30852,30572,30273,29956,29621,29269,28898,28511,28106,27684,27245,26790, 26319,25832,25330,24812,24279,23732,23170,22594,22005,21403,20787,20159,19519,
18868,18204,17530,16846,16151,15446,14732,14010,13278,12539,11793,11039,10278,
9512,8739,7961,7179,6392,5602,4808,4011,3211,2410,1607,804,0,-804,-1607,-2410,
-3211,-4011,-4808,-5602,-6392,-7179,-7961,-8739,-9512,-10278,-11039,-11793,-12539,
-13278,-14010,-14732,-15446,-16151,-16846,-17530,-18204,-18868,-19519,-20159,
-20787,-21403,-22005,-22594,-23170,-23732,-24279,-24812,-25330,-25832,-26319,
-26790,-27245,-27684,-28106,-28511,-28898,-29269,-29621,-29956,-30273,-30572,
-30852,-31114,-31357,-31581,-31785,-31971,-32138,-32285,-32413,-32521,-32610,
-32679,-32728,-32758,-32768,-32758,-32728,-32679,-32610,-32521,-32413,-32285,
-32138,-31971,-31785,-31581,-31357,-31114,-30852,-30572,-30273,-29956,-29621,
-29269,-28898,-28511,-28106,-27684,-27245,-26790,-26319,-25832,-25330,-24812,
-24279,-23732,-23170,-22594,-22005,-21403,-20787,-20159,-19519,-18868,-18204,
-17530,-16846,-16151,-15446,-14732,-14010,-13278,-12539,-11793,-11039,-10278,
-9512,-8739,-7961,-7179,-6392,-5602,-4808,-4011,-3211,-2410,-1607,-804,0,804,
1607,2410,3211,4011,4808,5602,6392,7179,7961,8739,9512,10278,11039,11793,12539,
13278,14010,14732,15446,16151,16846,17530,18204,18868,19519,20159,20787,21403,
22005,22594,23170,23732,24279,24812,25330,25832,26319,26790,27245,27684,28106,
28511,28898,29269,29621,29956,30273,30572,30852,31114,31357,31581,31785,31971,
32138,32285,32413,32521,32610,32679,32728,32758};
#pragma HLS RESOURCE variable=cos_table core=ROM_1P_BRAM
static ap_uint<32> phasesum = 0;

ap_uint<8> addr = phasesum.range(31 , 24);
phasesum = phasesum +FRQ_W;

*sin = cos_table[addr];

}
完整代码和仿真工程链接
https://download.csdn.net/download/weixin_37594197/88117149?spm=1001.2014.3001.5503

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值