Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   VHDL (http://www.velocityreviews.com/forums/f18-vhdl.html)
-   -   Problem with integer a vector range (http://www.velocityreviews.com/forums/t714627-problem-with-integer-a-vector-range.html)

nicx82 02-11-2010 03:32 PM

Problem with integer a vector range
 
My code:

Integer is an Integer Variable
OutputNumber is an Std_logic_Vector Input


Integer <= conv_integer(OutputNumber);
MyVector(37 downto (38-Integer)) <= Temp(37 downto (38-Integer));

Compiler Error:
Error (10454): VHDL syntax error: right bound of range must be a constant


PLEASE HELP ME.

sridar 02-12-2010 05:38 AM

I think, it is not possible to code like this way. Dynamic bus assignment while hardware is running doesn't seems to be a right way.

Since you are assigning the values base on user input,you are getting this error message and also if your integer value is zero, myvector value becomes (37 downto 38) which can't be done.

Re-think your logic keeping programing for hardware in mind.

If the integer value is constant or generic, this can be done.

Quote:

Originally Posted by nicx82
My code:

Integer is an Integer Variable
OutputNumber is an Std_logic_Vector Input


Integer <= conv_integer(OutputNumber);
MyVector(37 downto (38-Integer)) <= Temp(37 downto (38-Integer));

Compiler Error:
Error (10454): VHDL syntax error: right bound of range must be a constant


PLEASE HELP ME.



All times are GMT. The time now is 09:06 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.