Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Honored Contributor I
796 Views

Making Lookup Table from Matlab data sheet

Hi, I'm trying to make lookup table in Quartus 2. v.8.1. 

 

I think I can use a dual port RAM to make the LUT, 

 

but the original data sheet (lookup table) is large (16x48 per each table)  

 

and it is made in Matlab (2-dimension data array like Excel data sheet). 

 

How can I import the data from Matlab to build the LUT ? 

 

Please help me to solve this problem.
0 Kudos
5 Replies
Highlighted
Honored Contributor I
16 Views

Why not use a ROM? Do you need to update the look up table?  

 

When you instantiate memory blocks in the megacore wizard you can add a mif or hex file with the memory contents.  

 

//Ola
0 Kudos
Highlighted
Honored Contributor I
16 Views

MatLab should be flexible enough to format the data according to Quartus needs. Otherwise a tcl script will do. Some kind of programming is obviously required. 

 

I don't really understand the 16x48 point. MatLab should be expected to represent LUT data by a one-dimensional array, the 16x48 seems to be just a print format? If you're actually dealing with two-dimensional data, you have to think about a suitable mapping to FPGA embedded memory first. 

 

The same embedded FPGA memory can be used as RAM or ROM respectively, there's no real difference, execpt for the usage of available port signals. They are all mapped to altsyncram megafunction anyway.
0 Kudos
Highlighted
Honored Contributor I
16 Views

You can either generate a mif(or hex) file using Matlab programming. Alternatively a non-official shortcut is this: 

open a new mif file in quartus(you will get cells like spread sheet), set width and size,set data type to signed ...etc. 

go to matlab and display your data as column of integers, copy to clipboard then go to quartus mif and paste. In this way quartus does the work for you. 

I also commonly use this trick to convert data as well(hex to signed to binary...) and copy back to my work
0 Kudos
Highlighted
Honored Contributor I
16 Views

Thank you for helping me :) 

 

Actually the size 16x48 was the cell size (column * row in Excel or in Matlab). 

 

Sorry for poor describtion. 

 

I 'll try kaz's suggestion. I think it will work. :)
0 Kudos
Highlighted
Honored Contributor I
16 Views

Hi, 

 

I needed some help in creating my own look up table in matlab for windows. What are the ways through which i can match the input grayscale values to the output monitor grayscale values, ie. basically how can i know what are the monitor output values.
0 Kudos