christian.m
Newbie level 2
Hey guys,
I have searched a lot to solve this simple sounding problem but haven't anything helpful yet.
Yeah i know there is a thread on this board(https://www.edaboard.com/threads/66603/) with the exact same question - but the suggested answers just don't work and **broken link removed** wasn't helpful neither!
So, how to convert a "std_logic" type to an integer - i tried four :???: different approaches but without luck :
What bothers me the most is that version 3&4 won't work...
Could you please help me?! Thank you so much.:sad:
I have searched a lot to solve this simple sounding problem but haven't anything helpful yet.
Yeah i know there is a thread on this board(https://www.edaboard.com/threads/66603/) with the exact same question - but the suggested answers just don't work and **broken link removed** wasn't helpful neither!
So, how to convert a "std_logic" type to an integer - i tried four :???: different approaches but without luck :
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.all;
...
signal valid_vect : std_logic_vector(1 downto 0);
signal valid_bit : in std_logic
signal user_select: in std_logic; -- User select
...
valid_vect(user_select)<=in_valid; -- <= "Type error near user_select; current type std_logic; expecting type natural"
valid_vect(to_integer(unsigned(user_select)))<=in_valid; -- "Cannot convert type std_logic to type unsigned"
valid_vect(to_integer(unsigned(""&user_select)))<=in_valid; -- <= does't work either : "found '4' definitions of operator "&", cannot determine excat overloaded mathich definitiion for "&" "
valid_vect(to_integer(unsigned("0"&user_select)))<=in_valid; -- <= does't work: "found '4' definitions of operator "&", cannot determine excat overloaded mathich definitiion for "&" "
What bothers me the most is that version 3&4 won't work...
Could you please help me?! Thank you so much.:sad:
Last edited by a moderator: