t***@gmail.com
2020-03-06 17:17:11 UTC
Hello good people of google,
I am trying to assign a certain part of a SLV(std_logic_vector) to another shorter SLV, and forcing the remaining to be '0'.
Ex, lets assign the middle 5 bits of big_word to small word.
--
Signal big_word :std_logic_vector(10 - 1 downto 0) := (others => '0');
Signal small_word :std_logic_vector(5 - 1 downto 0) := (others => '0');
...
Begin
-- I can of course use this, but this is not very elegant for large SLVs
Big_word <= "000" & small_word & "00";
--I would like to do something more like:
Big_word <= (7 -1 downto 2 => small_word, others => '0');
--The tool I am using (vivado 2018.3) complains about small_word not being of type std_ulogic. Well the word is larger than 1 bit, so that is an issue.
--
My constraints are:
VHDL '87
Using ieee.std_logic_1164.all
Using ieee.numeric_std
Make this assignment in 1 line
I really appreciate the help
CT
I am trying to assign a certain part of a SLV(std_logic_vector) to another shorter SLV, and forcing the remaining to be '0'.
Ex, lets assign the middle 5 bits of big_word to small word.
--
Signal big_word :std_logic_vector(10 - 1 downto 0) := (others => '0');
Signal small_word :std_logic_vector(5 - 1 downto 0) := (others => '0');
...
Begin
-- I can of course use this, but this is not very elegant for large SLVs
Big_word <= "000" & small_word & "00";
--I would like to do something more like:
Big_word <= (7 -1 downto 2 => small_word, others => '0');
--The tool I am using (vivado 2018.3) complains about small_word not being of type std_ulogic. Well the word is larger than 1 bit, so that is an issue.
--
My constraints are:
VHDL '87
Using ieee.std_logic_1164.all
Using ieee.numeric_std
Make this assignment in 1 line
I really appreciate the help
CT