dynamically accessed subrange of a vector

Discussion in 'VHDL' started by seanovsky, Nov 18, 2009.

  1. seanovsky

    seanovsky

    Joined:
    Nov 18, 2009
    Messages:
    1
    Hi all,

    I have a std_logic_vector, 'D' thats 88 bits wide. I want to be able to select any 18 contiguous bits, 'B', from this vector using a signal 'S'. For example, when S = 0, select B <= D(17 downto 0), when S = 1, select B <= D(18 downto 1),..., when S = 70, select B <= D(87 downto 70).

    Instead of writing out these 71 lines, is there a way I can do something like this:

    B <= D(S+17 downto S) in order to dynamically access a subrange of a vector?

    Thanks,

    Sean
     
    seanovsky, Nov 18, 2009
    #1
    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. tom_usenet

    Re: Iterators in a subrange?

    tom_usenet, Jul 1, 2003, in forum: C++
    Replies:
    0
    Views:
    402
    tom_usenet
    Jul 1, 2003
  2. pmatos
    Replies:
    6
    Views:
    23,821
  3. Allerdyce.John@gmail.com
    Replies:
    8
    Views:
    1,930
    Csaba
    Feb 18, 2006
  4. Javier
    Replies:
    2
    Views:
    567
    James Kanze
    Sep 4, 2007
  5. Rushikesh Joshi
    Replies:
    0
    Views:
    365
    Rushikesh Joshi
    Jul 10, 2004
Loading...

Share This Page