alkaios
Newbie level 5
- Joined
- Nov 9, 2010
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,419
hello! i have a problem in vhdl and i hope you can help me
i want to take LS bits from a signal, but the number of these bits it's not certain.
to be more specific, i want to do this:
a <= b(x-1 downto 0).
a, b, x are std_logic_vectors. x is calculated somewhere else in my program.
range of a should be x bits, range of b is 54 bits, range of x is 8 bits.
i already tried something obvious:
signal xx : integer range 0 to 7 := TO_INTEGER(UNSIGNED(x));
signal a : std_logic_vector(xx-1 downto 0);
a <= b(xx-1 downto);
but it doesn't work. any suggestions? is there any attribute or function that can help?
thanx in advance.
i want to take LS bits from a signal, but the number of these bits it's not certain.
to be more specific, i want to do this:
a <= b(x-1 downto 0).
a, b, x are std_logic_vectors. x is calculated somewhere else in my program.
range of a should be x bits, range of b is 54 bits, range of x is 8 bits.
i already tried something obvious:
signal xx : integer range 0 to 7 := TO_INTEGER(UNSIGNED(x));
signal a : std_logic_vector(xx-1 downto 0);
a <= b(xx-1 downto);
but it doesn't work. any suggestions? is there any attribute or function that can help?
thanx in advance.