How to generate a look-up table from MATLAB on FPGA in Verilog?

Status
Not open for further replies.

Amir.B

Newbie level 3
Joined
Feb 22, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Mashhad, IRAN
Activity points
1,303
hi dear all...
I have a vector consist of sine and cosine valus (A complex exponential) in MATLAB. How to generate a look-up table with this values in verilog?
I know that should be use a b-RAM, but I don't know how to write verilog code. please help me.
the values placed in a 4096×1 vector in MATLAB. I think a 4K RAM should be used, is it correct? please help...
 

use vhdl/verilog language templates in your system. For a example Xilinx ISE has a good set of hdl synthesis templates(counters, block ram, ...). if you know a little of verilog i will understande.

Block Dual RAM :
parameter RAM_WIDTH = <ram_width>;
parameter RAM_ADDR_BITS = <ram_addr_bits>;

(* RAM_STYLE="{AUTO | BLOCK | BLOCK_POWER1 | BLOCK_POWER2}" *)
reg [RAM_WIDTH-1:0] <ram_name> [(2**RAM_ADDR_BITS)-1:0];
reg [RAM_WIDTH-1:0] <output_data>;

<reg_or_wire> [RAM_ADDR_BITS-1:0] <read_address>, <write_address>;
<reg_or_wire> [RAM_WIDTH-1:0] <input_data>;

// The following code is only necessary if you wish to initialize the RAM
// contents via an external file (use $readmemb for binary data)
initial
$readmemh("<data_file_name>", <rom_name>, <begin_address>, <end_address>);

always @(posedge <clock>) begin
if (<write_enable>)
<ram_name>[<write_address>] <= <input_data>;
<output_data> <= <ram_name>[<read_address>];
end

---------- Post added at 16:35 ---------- Previous post was at 16:34 ----------

Pardon , "if you know a little of verilog i will understande" -> if you know a little of verilog YOU will understand )
 

Thank you so much dear kirill, for your kind consideration...
 

i feel a small sarcasm in your sentence
 
Reactions: zel

    zel

    Points: 2
    Helpful Answer Positive Rating
No, No, Never...
Your guide was so useful for me, I say this seriously...
thanks, once again!
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…