MSAKARIM
Full Member level 3
Is this code right?, I need to convert from STD_LOGIC to integer( to add those integers) and then back result to STD_LOGIC:
a,h,f3,f0,k,w,f2,f1 are STD_Logic
a,h,f3,f0,k,w,f2,f1 are STD_Logic
Code:
a <= std_logic_vector(to_unsigned((To_integer(unsigned(h)) +
To_integer(unsigned(f3)) +
To_integer(unsigned(f0)) +
To_integer(unsigned(k)) +
To_integer(unsigned(w)) +
To_integer(unsigned(f2)) +
To_integer(unsigned(f1))),a'length));