dynamically accessed subrange of a vector

Joined
Nov 18, 2009
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top