-
Verilog实现的Matlab代码DDS
资源介绍
Matlab代码verilog
DDS
使用Matlab的vivado
2016.4
该项目主要从matlab生成.coe文件,.coe文件是余弦波。
Matlab代码:/
----------------------------------------------
------------------------------------------
/
clc;清除;
宽度=
8;
深度=
1024;
x
=
linspace(0,2
*
pi,depth);
y_cos
=
cos(x);
y_cos
=
round(y_cos
*(2
^(width-1)-1));
情节(x,y_cos);
fid
=
fopen('C:\
Users
\
72721
\
Desktop
\
1.coe','w');
fprintf(fid,'memory_initialization_radix
=
10;
\
nmemory_initialization_vector\n='\uff09;\n\u5bf9\u4e8ei\n=\n1\uff1a\u6df1\u5ea6\nif\nmod(i-1,8)==0\nfprintf(fid,'\n');
end
fprint