Lookup tables

Discussion in 'VHDL' started by Mike, Nov 29, 2007.

  1. Mike

    Mike Guest

    Hi

    I just wonder what is a proper way to implement lookup tables in VHDL?
    I was thinking of using a Register. The thing is that I have 4 32 bit
    input values. So each output bit is determined by the corresponding 4
    single input bits which could be mapped than to 16 potentital values.
    As I have 32 bit input values I would need a register that is 32*16
    times big so that I could make the look up tables in parallel is that
    right?

    Cheers!
     
    Mike, Nov 29, 2007
    #1
    1. Advertising

  2. Mike

    Andy Guest

    On Nov 29, 8:01 am, Mike <> wrote:
    > Hi
    >
    > I just wonder what is a proper way to implement lookup tables in VHDL?
    > I was thinking of using a Register. The thing is that I have 4 32 bit
    > input values. So each output bit is determined by the corresponding 4
    > single input bits which could be mapped than to 16 potentital values.
    > As I have 32 bit input values I would need a register that is 32*16
    > times big so that I could make the look up tables in parallel is that
    > right?
    >
    > Cheers!


    So you would need 32 sixteen-entry constant arrays. Index each array
    with the 4 input bits.

    VHDL constants can be initialized discretely, or with a function call,
    if that helps. Depending on surrounding registers, etc. they can be
    implemented as distributed rams(roms), or combined as a block
    ram(rom).

    Andy

    Andy
     
    Andy, Nov 29, 2007
    #2
    1. Advertising

  3. Mike

    Mike Guest


    > So you would need 32 sixteen-entry constant arrays. Index each array
    > with the 4 input bits.
    >
    > VHDL constants can be initialized discretely, or with a function call,
    > if that helps. Depending on surrounding registers, etc. they can be
    > implemented as distributed rams(roms), or combined as a block
    > ram(rom).


    Thanks for your comment. But all this lookup table have the same
    content, so I could just use one lookup table and then multiplexors to
    get the right values out of the array?
     
    Mike, Nov 29, 2007
    #3
  4. Mike

    Andy Guest

    On Nov 29, 8:55 am, Mike <> wrote:
    > > So you would need 32 sixteen-entry constant arrays. Index each array
    > > with the 4 input bits.

    >
    > > VHDL constants can be initialized discretely, or with a function call,
    > > if that helps. Depending on surrounding registers, etc. they can be
    > > implemented as distributed rams(roms), or combined as a block
    > > ram(rom).

    >
    > Thanks for your comment. But all this lookup table have the same
    > content, so I could just use one lookup table and then multiplexors to
    > get the right values out of the array?


    Depends on whether you need to use the table for more than one value
    simultaneously. If not, then yes, a multiplexer would work. If it is
    used simultaneously, the synthesis tool should figure it out and make
    multiple copies.

    Andy
     
    Andy, Nov 29, 2007
    #4
    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. Demetri
    Replies:
    0
    Views:
    341
    Demetri
    Oct 15, 2003
  2. Jack
    Replies:
    0
    Views:
    367
  3. Adrian Charteris

    XSLT Lookup Tables Help.

    Adrian Charteris, Oct 15, 2004, in forum: XML
    Replies:
    4
    Views:
    956
    Adrian Charteris
    Oct 18, 2004
  4. John Collyer

    Function lookup tables?

    John Collyer, Oct 4, 2003, in forum: C++
    Replies:
    12
    Views:
    1,307
    Karl Heinz Buchegger
    Oct 6, 2003
  5. Replies:
    6
    Views:
    312
Loading...

Share This Page