How to get most significant bits

Q

qharz

Hi
How to get 17 oldest bits from variable std_logic_vector (17 + 2*CONSTANT
downto 0)
CONSTANT is changing manually before every compilation.

Thanks
 
J

JimLewis

Hi
How to get 17 oldest bits from variable std_logic_vector (17 + 2*CONSTANT
downto 0)
CONSTANT is changing manually before every compilation.

Thanks


signal V : std_logic_vector (17 + 2*MY_CONST downto 0) ;
signal L, R : std_logic_vector(16 downto 0) ;


-- 17 left most bits:
L <= V(V'left downto V'left - 16) ;

-- 17 right most bits
R <= V(16 downto 0) ;


Not sure what you mean by oldest, so those are my best guesses.

Cheers,
Jim
 

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

No members online now.

Forum statistics

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

Latest Threads

Top