Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start ---
output(to_integer(unsigned(msbd) + unsigned(lsb)) downto 0) <= bit_field(to_integer(unsigned(msbd) + unsigned(lsb)) downto to_integer(lsb));
bit_field and output are 32 bit std_logic_vector msbd and lsb are 5 bit std_logic_vectors --- Quote End --- Basically you are trying to do this: LHS(msb + lsb downto 0) <= RHS(msb + lsb downto lsb) ; which doesn't work as the LHS is wider than the RHS. Using for-loop won't work either as a for-loop needs constant boundaries as well. You could use a barrel shifter to dynamically align data.