T
Tero Kapanen
Guest
I have variables declared as:
variable data : std_logic_vector (9 downto 0);
variable temp : std_logic_vector (2 downto 0);
I want to take a slice of the data and put it to temp. I have done it like:
temp(0) := data(5);
temp(1) := data(4);
temp(2) := data(3);
It works like it should but my problem is that it is not elegant solution.
Maybe someday I want to slice 64 bits and then I would prefer some other
way.
I can always write a function for it but isn't there already one or what is
the most elegant way to do it.
- tero
variable data : std_logic_vector (9 downto 0);
variable temp : std_logic_vector (2 downto 0);
I want to take a slice of the data and put it to temp. I have done it like:
temp(0) := data(5);
temp(1) := data(4);
temp(2) := data(3);
It works like it should but my problem is that it is not elegant solution.
Maybe someday I want to slice 64 bits and then I would prefer some other
way.
I can always write a function for it but isn't there already one or what is
the most elegant way to do it.
- tero