fid=fopen('./test.mif','W' ); % test.mif is the file which you want to use in Quartus II %
fprintf(fid,'WIDTH=2;\n'); % WIDTH is the word band %
fprintf(fid,'DEPTH=4096;\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');
y = randi([0 3],1,4096);
for x = 1:4096
fprintf(fid,'%d:%d;\n',x-1,y(x));
end
fprintf(fid,'END;'); % the end of the file %
fclose(fid);
matlab生成mif文件
最新推荐文章于 2024-06-08 23:58:14 发布