Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Use a table in VHDL

 
Thread Tools Search this Thread
Old 10-21-2004, 02:19 PM   #1
Default Use a table in VHDL


Hi everyone, I´m trying to find some tutorial for implement a table in
VHDL. This is my intention:

- I have a 8x8 table made in Matlab
- Depending of two inputs, which can go from 1 to 8,
- I need to have at the output the corresponding value of the mentioned
table.

What´s the simpliest way to do it? I have heard something about Look up
Tables (LUT), but I don´t know if this is the better solution... and if it
is, can someone give me a basic paper?

Thanks a lot, and sorry for my poor english!

Thanks a lot



eneko
  Reply With Quote
Old 10-21-2004, 02:37 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: Use a table in VHDL
eneko wrote:

> - I have a 8x8 table made in Matlab
> - Depending of two inputs, which can go from 1 to 8,
> - I need to have at the output the corresponding value of the mentioned
> table.


Consider an array of 8 bit vectors.
>
> What´s the simpliest way to do it? I have heard something about Look up
> Tables (LUT),


Thats a device primitive, not a VHDL type.

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 10-21-2004, 03:05 PM   #3
eneko
 
Posts: n/a
Default Re: Use a table in VHDL
thanks Mike, but:
How I implement this table, whith an if estructure? case?
I thought it was a better way to do it,
and, what do you say whith "device primitive"? sorry but I don´t
understand you.
Thanks one more time.



eneko
  Reply With Quote
Old 10-21-2004, 04:43 PM   #4
rickman
 
Posts: n/a
Default Re: Use a table in VHDL
eneko wrote:
>
> Hi everyone, I´m trying to find some tutorial for implement a table in
> VHDL. This is my intention:
>
> - I have a 8x8 table made in Matlab
> - Depending of two inputs, which can go from 1 to 8,
> - I need to have at the output the corresponding value of the mentioned
> table.
>
> What´s the simpliest way to do it? I have heard something about Look up
> Tables (LUT), but I don´t know if this is the better solution... and if it
> is, can someone give me a basic paper?
>
> Thanks a lot, and sorry for my poor english!


You did not say what your data is in the table. But a simple array of
63 downto 0 will do the job if you append the two indicies into one
index. You also did not say what the indicies are. Do you know the
source of the indicies? Will they be slv or integers?

--

Rick "rickman" Collins


Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design URL http://www.arius.com
4 King Ave 301-682-7772 Voice
Frederick, MD 21701-3110 301-682-7666 FAX


rickman
  Reply With Quote
Old 10-21-2004, 05:03 PM   #5
eneko
 
Posts: n/a
Default Re: Use a table in VHDL
Thanks for all, finally I think I will use a bidimensional array for my
purposes, in this way (with 4 positions):

type table is array (1 to 4, 1 to 4) of integer;
signal table1:table;

Then I fill the gaps in this way:

table1<=((1,2,3,4),(4,3,2,1),(1,1,1,1),(2,2,2,2));

And if I want something from this table:

number<=table1(2,3)
and will return number 2.

I will hope this can be useful for other beginner like me.

Thanks for all !!




eneko
  Reply With Quote
Old 10-21-2004, 07:56 PM   #6
Tom Verbeure
 
Posts: n/a
Default Re: Use a table in VHDL

> Thanks for all, finally I think I will use a bidimensional array for

my
> purposes, in this way (with 4 positions):


This may not work for some synthesis tools. Synopsys DC didn't support
more-dimensional arrays for a long time (I think it does now with the
Presto version, not sure). The work-around is to use an array of an
array instead, which works with pretty much all major synthesis tools.

Eg.
type t_IntArray is array(7 downto 0) of integer;
type t_IntArrayArray is array(7 downto 0) of t_IntArray;

signal myIntAA : t_IntArrayArray.

....

element <= myIntAA(index1)(index2);

(instead of: element <= myIntAA(index1, index);

Note that using an integer will create 32 FF's per element. If you want
to synthesize this later on, you may want to restrict the range of the
integer...

Tom



Tom Verbeure
  Reply With Quote
Old 10-25-2004, 09:42 AM   #7
Thomas Stanka
 
Posts: n/a
Default Re: Use a table in VHDL
"eneko" <> wrote:
> - I have a 8x8 table made in Matlab
> - Depending of two inputs, which can go from 1 to 8,
> - I need to have at the output the corresponding value of the mentioned
> table.
>
> What´s the simpliest way to do it? I have heard something about Look up
> Tables (LUT), but I don´t know if this is the better solution... and if it
> is, can someone give me a basic paper?


Use some constants (like the std_logic definition).

For one input you need one table
eg:
type sig is array 3 downto 0 of std_logic_vector(1 downto 0);
constant SIG<=("00","01","10","11");
output_vector<=SIG(2)

For two dimensions I would use more tables to ensure the synthesis
tool could manage the code and build a maintype as array of tables.

bye Thomas


Thomas Stanka
  Reply With Quote
Old 10-25-2004, 02:11 PM   #8
eneko
 
Posts: n/a
Default Re: Use a table in VHDL
I will change it,

Thanks for all!!



eneko
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute an external software from VHDL? And how to interface VHDL with JAVA? becool_nikks Software 0 03-06-2009 07:08 PM
Look Up Table In VHDL cienhui General Help Related Topics 0 10-22-2008 05:35 PM
Help on auto conversion from Matlab to vhdl on filter design hardheart Hardware 0 12-07-2007 09:19 AM
ARRAY(n DOWNTO 0) OF STD_LOGIC_VECTOR(m DOWNTO 0) - VHDL freitass Hardware 0 11-01-2007 03:44 PM
High-Def Playback: The Firmware Gotcha Ablang DVD Video 46 07-28-2007 07:25 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46