convert std_logic_vector to integer in Quartus

Status
Not open for further replies.

EDA_hg81

Advanced Member level 2
Joined
Nov 25, 2005
Messages
507
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
4,808
std_logic_vector to integer

I am using Altera Quartus II.

Please let me know which function can convert std_logic_vector to integer.

Thanks.
 

convert std_logic_vector to integer

Under ieee.std_logic_arith, it's:
Code:
int_signal1  <= conv_integer(UNSIGNED(slv_signal1));
int_signal2  <= conv_integer(SIGNED(slv_signal2));
Under numeric_std library, the conversion should look similar.
 

integer to std_logic_vector

use ieee.numeric_std.all;

...<= to_integer(unsigned(....));
...<= to_integer(signed(....));
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…