O
Olaf Petzold
Guest
Hi,
this time a question concerning a cosmetic change. I assign a
subvector/slice with leading zero to a new one like this way:
foo : std_logic_vector(7 downto 0);
bar : std_logic_vector(15 downto 0);
.....
constant ZERO_PAD : std_logic_vector(5 downto 0) := (others => '0');
.....
foo <= ZERO_PAD & bar(1 downto 0);
Is there a better way avoiding the ZERO_PAD constant, like
foo <= (1,2 => bar(1 downto 0), others => '0');
which doesn't compile?:
Type conflict in integer literal. (Type 'std_logic' versus 'integer'.)
Cannot resolve slice name as type std_logic.
Associations in array aggregate must be all named or all positional.
Thanks
Olaf
this time a question concerning a cosmetic change. I assign a
subvector/slice with leading zero to a new one like this way:
foo : std_logic_vector(7 downto 0);
bar : std_logic_vector(15 downto 0);
.....
constant ZERO_PAD : std_logic_vector(5 downto 0) := (others => '0');
.....
foo <= ZERO_PAD & bar(1 downto 0);
Is there a better way avoiding the ZERO_PAD constant, like
foo <= (1,2 => bar(1 downto 0), others => '0');
which doesn't compile?:
Type conflict in integer literal. (Type 'std_logic' versus 'integer'.)
Cannot resolve slice name as type std_logic.
Associations in array aggregate must be all named or all positional.
Thanks
Olaf