What is the best way to generate 6 set 3-bit address

Discussion in 'VHDL' started by fl, Jun 16, 2008.

  1. fl

    fl Guest

    Hi,
    I know that an FSM can do the work, but I would like to know whether
    it is the best way. The problem is to generate 6 addresses, each is a
    3-bit set : 000, 001, 010, 100, 101, 110. Thanks a lot.
    fl, Jun 16, 2008
    #1
    1. Advertising

  2. fl wrote:

    > I know that an FSM can do the work, but I would like to know whether
    > it is the best way. The problem is to generate 6 addresses, each is a
    > 3-bit set : 000, 001, 010, 100, 101, 110. Thanks a lot.


    I would declare and use a constant vector array.
    Mike Treseler, Jun 16, 2008
    #2
    1. Advertising

  3. fl

    Andy Guest

    On Jun 16, 4:12 pm, Mike Treseler <> wrote:
    > fl wrote:
    > > I know that an FSM can do the work, but I would like to know whether
    > > it is the best way. The problem is to generate 6 addresses, each is a
    > > 3-bit set : 000, 001, 010, 100, 101, 110. Thanks a lot.

    >
    > I would declare and use a constant vector array.


    It depends on what is important about how the addresses are generated.
    Are they necessarily in increments of one, skipping every 4th one, or
    is that just a coincidence? For something simple (few resources, and
    shouldn't take much time), think about coding it such that the
    requirements are most clear. If they are supposed to increment, code
    an adder with some skip logic. If they are (or could be) arbitrary,
    Mike's suggestion of a constant lookup table is excellent. A good
    synthesis tool would probably implement the same circuit with either
    description for something this small. If not, a constant lookup table
    can be initialized via a function that illustrates the algorithm. That
    way, you get the illustrative benefits of an algorithm, with the
    resource/performance benefits of a look-up table. Another advantage of
    an algorithm is that it can usually be expanded easily if more
    addresses are needed in the same pattern.

    Also, depending on your application, it is sometimes easier to mask
    off unused addresses such that nothing happens when they are accessed
    (i.e. AND the data being stored with a constant mask that is set to
    zeroes for the unused addresses, and apply the same mask when reading
    the registers), rather than going to the trouble to avoid them. If
    properly done, the masking will result in the resources for those
    unused addresses being optimized away.

    Andy
    Andy, Jun 17, 2008
    #3
    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. Replies:
    3
    Views:
    1,714
    Timothy Bendfelt
    Jan 19, 2007
  2. onsbomma
    Replies:
    63
    Views:
    2,284
    Randy Howard
    Mar 21, 2005
  3. Replies:
    9
    Views:
    938
    Juha Nieminen
    Aug 22, 2007
  4. Jeff.M
    Replies:
    6
    Views:
    162
    Lasse Reichstein Nielsen
    May 4, 2009
  5. Charles Hixson

    bit count or bit set && Python3

    Charles Hixson, Oct 25, 2012, in forum: Python
    Replies:
    5
    Views:
    198
    Charles Hixson
    Oct 26, 2012
Loading...

Share This Page