Use a table in VHDL

Discussion in 'VHDL' started by eneko, Oct 21, 2004.

  1. eneko

    eneko Guest

    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, Oct 21, 2004
    #1
    1. Advertising

  2. 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, Oct 21, 2004
    #2
    1. Advertising

  3. eneko

    eneko Guest

    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, Oct 21, 2004
    #3
  4. eneko

    rickman Guest

    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, Oct 21, 2004
    #4
  5. eneko

    eneko Guest

    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, Oct 21, 2004
    #5
  6. eneko

    Tom Verbeure Guest


    > 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, Oct 21, 2004
    #6
  7. "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, Oct 25, 2004
    #7
  8. eneko

    eneko Guest

    I will change it,

    Thanks for all!!
     
    eneko, Oct 25, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    3
    Views:
    4,882
    walala
    Sep 18, 2003
  2. David Williams
    Replies:
    2
    Views:
    1,181
    Jacob Yang [MSFT]
    Aug 12, 2003
  3. Ken Dopierala Jr.

    Do you use <table> or <asp:Table>?

    Ken Dopierala Jr., Jan 12, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,740
    Craig Deelsnyder
    Jan 13, 2004
  4. Rio
    Replies:
    4
    Views:
    1,249
  5. afd
    Replies:
    1
    Views:
    8,562
    Colin Paul Gloster
    Mar 23, 2007
Loading...

Share This Page