VHDL fill rest of the vector in assignment

Guest #3543565
Rate this post
useful
not useful
Hello,
I'd like to assign a value to an std_logic_vector, and fill the rest of 
the vector with zeros. The length of the vector is defined with a 
generic or a constant.
So it would be like this (but this does not work):

signal my_signal : std_logic_vector(CONST_WIDTH downto 0);
my_signal <= (others => '0') & x"2";

It could be done with a for generate statement, but are there any 
shorter and nicer solutions?

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now