Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > dynamically accessed subrange of a vector

Thread Tools

dynamically accessed subrange of a vector

seanovsky seanovsky is offline
Junior Member
Join Date: Nov 2009
Posts: 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?


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
const vector<A> vs vector<const A> vs const vector<const A> Javier C++ 2 09-04-2007 08:46 PM
Initializing vector<vector<int> > and other vector questions... pmatos C++ 6 04-26-2007 05:39 PM
Free memory allocate by a STL vector, vector of vector, map of vector C++ 8 02-18-2006 12:48 AM
how the vector is created, how to pass vector to webservices method apachesoap:Vector Rushikesh Joshi Perl Misc 0 07-10-2004 01:04 PM
Re: Iterators in a subrange? tom_usenet C++ 0 07-01-2003 01:05 PM