We have a type which is an array of 32 bit "std_logic_vector" of size 3, which is defined in the following way:
subtype scalar is std_logic_vector(31 downto 0);
type vector_nd is array (natural range <>) of scalar;
subtype vector_3d is vector_nd(2 downto 0);
We have a signal of type "vector_3d" which we want to multiply by 2 and put the result in a signal of type "scalar":
signal v_normal_out_sig := vector_3d;
signal mult1_in1_sig := scalar;
--...
mult1_in1_sig <= 2*signed(v_normal_out_sig(0)) when cau_state = st_cycle18;
When we compile it we get the error:
No feasible entries for infix operator "*".
What is the right way to implement what we want? We are using the following libraries:
- ieee.std_logic_1164.all
- ieee.std_logic_arith.all
- ieee.std_logic_unsigned.all
v_normal_out_sig(0)signal by 1 bit to achieve a multiplication by 2. Consider using the functions provided by thenumeric_stdlibrary (i.e.SHIFT_LEFT). - simonSHIFT_LEFTfunction takes care of that. However, your own function should also be fine. I'd still suggest making use of thenumeric_stdfunctions for cleaner and (arguably) better readable code. - simon