MATLAB: I have a 415×7 matrix of floating point values in text file. I need to convert these values into fixed point numbers so that I can use this matrix as input in verilog. Can someone please tell how can I do it

fixed point floating point matlab verilog

I have a 415×7 matrix of floating point values in text file. I need to convert these values into fixed point numbers so that I can use this matrix as input in verilog. Can someone please tell how can I do it?

Best Answer

You can use the fi function to convert the floating point values to fixed point. fi also lets you get the hex or bin equivalent of the numbers which you can write back into a file as text and read in Verilog with fscanf/memreadh/memreadb.
Related Question