fid=fopen('../test1.mif','W' ); % test1.mif is the file which you want to use in Quartus II %
fprintf(fid,'WIDTH=8;/n'); % WIDTH is the word band %
fprintf(fid,'DEPTH=128;/n/n'); % DEPTH is the the number of datas %
fprintf(fid,'ADDRESS_RADIX=UNS;/n');
fprintf(fid,'DATA_RADIX=UNS;/n/n');
fprintf(fid,'CONTENT BEGIN/n/n');
x=0:1:127;
y=round(31*sin(pi*x/64))+32;
fprintf(fid,'%d:%d;/n',x,y);
fprintf(fid,'END;'); % the end of the file %
fclose(fid);
plot(x,y);
grid on;
matlab生成quartus中可用的.mif文件
最新推荐文章于 2024-02-07 19:15:57 发布