Forum Discussion
Altera_Forum
Honored Contributor
16 years agoProblem with integer variable and vector range
My code: Int is an Integer Variable OutputNumber is a Std_logic_Vector Input Int <= conv_integer(OutputNumber); MyVector(37 downto (38-Int)) <= Temp(37 downto (38-Int)); Quart...
Altera_Forum
Honored Contributor
16 years agoFrom your code snippet, it's not fully clear, what you want to achieve. If you want to copy a variable number of bits depending on another condition, you can use a for loop iteration scheme.
for i in 0 to 37 loop
if i >= 38 - int then
MyVector(i) <= Temp(i);
end if;
end loop;