Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

Why the type converter does not work ?

$
0
0
In my design I need to do is convert a std_logic_vector signal to the integer signal for array index. Then I do following:
"


use IEEE.NUMERIC_STD.ALL;

generic

(
C_SLV_ADWIDTH : integer := 6; -- This width is actual address width
)

constant C_NUM_REG : integer := 2 ** C_SLV_ADWIDTH;


signal slv_addr : std_logic_vector(C_SLV_ADWIDTH-1 downto 0);
signal slv_addr_integer : integer range 0 to C_NUM_REG;


slv_addr_integer <= to_Integer(slv_addr); -- this convert data type std_logic_vector to integer

"
But I get errors, why converter does not work?

Thanks in advance.

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>