Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

VHDL signal assignment with the OTHERS keyword

I'm not sure I'm posting this in the right place but I want to assign an unsigned or std_logic_vector to the same type of a larger size.

Input is 8 bits wide, outputsignal is 32 bits wide and I want to assign inputsignal(7 downto 0) to outputsignal(23 downto 16) with all other bits (31 downto 24 and 15 downto 0) in output being '0'.

I've been trying to do this using the others keyword but I'm not quite sure how to do assignments like that with multiple bits at once.

So something like this:

outputsignal <= ((23 downto 16) => inputsignal(7 downto 0), others => '0');

but in a way that the compiler understands...

11 Replies