其他分享
首页 > 其他分享> > 如何在ISE中调用Block Memory Generator实现rom?

如何在ISE中调用Block Memory Generator实现rom?

作者:互联网

ISE中调用Block Memory Generator实现rom?

一、.coe文件的格式

;This .COE file specifies the contents for a block memory of depth=256, and width=8.
memory_initialization_radix=16;
memory_initialization_vector =
00,
01,
02,
03,
04,
……
FC,
FD,
FE,
FF;

二、.coe文件的生成matlab代码样例

clear;
clc;

fid = fopen('c:/cos_coe.txt','w'); % 生成TXT文件
fprintf( fid, 'memory_initialization_radix=10;\n');%生成索引
fprintf( fid, 'memory_initialization_vector =\n' );

for a = 0:15
  for b = 0:15
    addr = a*16+b;
     fprintf(fid,'%X;\n',addr);%量化数据格式,具体说明见前面,注意其中的逗号!
  end
end

fclose(fid);

标签:radix,rom,Generator,initialization,fprintf,fid,memory,coe,ISE
来源: https://www.cnblogs.com/shihaoyang/p/15724991.html