I need to take the absolute value of a result and I am only interested in the most significant bits. This is what I have done:
data_ram_h <= std_logic_vector(abs(signed(resize(r4(calc_cnt - 2), data_ram_h'length) + r4(calc_cnt - 1) +
r4(calc_cnt) + r4(calc_cnt + 1) + r4(calc_cnt + 2) -
r2(calc_cnt - 2) - r2(calc_cnt - 1) - r2(calc_cnt) -
r2(calc_cnt + 1) - r2(calc_cnt + 2))))(11 downto 4);
I try to check the syntax and I get this error:
type conversion std_logic_vector is not allowed as a prefix for an slice name.
data_ram_h is a std_logic_vector of the right dimension, and the abs function returns a signed, to there shouldn't be problem in the conversion to std_logic_vector. The library I am using is use ieee.numeric_std.all.
Where am I wrong? Thanks in advance c: