abhiphull's posts

4 posts found

Re: text to mif conversion

  By: abhiphull on Feb. 22, 2021, 2:54 a.m.

Hi Zainab,

data is the vector(array) in Matlab that contains your data to be written into named mif file. It is meant to be signed integer (no fractions) in the code (since data radix is made decimal).

if your data is not scaled then the following…

Re: text to mif conversion

  By: abhiphull on Feb. 22, 2021, 2:54 a.m.

i have this full program,its work.but then when i want to change the spesific size,it have the error.

name = 'image';
img = imread(strcat(name,'.gif'));
g = im2double(img);
g = g/max(max(g));
rgb = cat(3,g,g,g);
imshow(rgb);
out = ones(480,640);
ou…

Re: text to mif conversion

  By: abhiphull on Feb. 22, 2021, 2:53 a.m.

Hi,

You better use a program to write the mif files as copy/paste is suitable for small size data.

Here is an example

Using Matlab to write 256 signed data to 16 bit mif:

fid = fopen('filename.mif','w');
fprintf(fid,'--MIF data generated by MATL…

Re: text to mif conversion

  By: abhiphull on Feb. 22, 2021, 2:52 a.m.

I assume you use Matlab, here is short cut:

convert your data to signed integers:
data = round(data *(2^15-1)/max(data)); %for 16 bits mif

then display as column:
data'

copy and paste the column to a mif in quartus as follows:
open a new mif with…