Hi,
I'm trying to do multiplication between a negative integer and a vector and I'm getting errors
what is wrong with this code (this is only a part of it)
thanks,
Avi
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all ;
ENTITY example IS
PORT(
clk : IN std_logic
);
END example;
ARCHITECTURE arc_example OF example IS
CONSTANT matrix_depth : integer := 3;
subtype matrix_width is std_logic_vector(7 downto 0);
type matrix_type is array (matrix_depth downto 0) of matrix_width;
signal matrix : matrix_type;
subtype multiply_matrix_width is std_logic_vector(15 downto 0);
type multiply_type is array (matrix_depth downto 0) of multiply_matrix_width;
signal multiply : multiply_type;
BEGIN
-- FROM IEEE.NUMERIC_STD:
-- function "*" (L: INTEGER; R: SIGNED) return SIGNED;
-- Result subtype: SIGNED((R'LENGTH+R'LENGTH-1) downto 0)
-- Result: Multiplies a SIGNED vector, R, with an INTEGER, L. L is
-- converted to a SIGNED vector of SIZE R'LENGTH before
-- multiplication.
PROCESS (clk)
BEGIN
IF clk'event AND clk = '1' THEN
multiply(0) <= ((-1) * matrix(0) );
multiply(1) <= ((-1) * matrix(1) );
multiply(2) <= ((-1) * matrix(2) );
multiply(3) <= ((-1) * matrix(3) );
END IF;
END PROCESS;
END arc_example;
The errors that I receive from Synplicity:
--VHDL syntax check successful!
--Synthesizing work.example.arc_example
--@E:"C:\My Documents\temp.vhd":36:26:36:40|No matching overload for "*"
--@E:"C:\My Documents\temp.vhd":37:26:37:40|No matching overload for "*"
--@E:"C:\My Documents\temp.vhd":38:26:38:40|No matching overload for "*"
--@E:"C:\My Documents\temp.vhd":39:26:39:40|No matching overload for "*"
--Synthesis failed
I'm trying to do multiplication between a negative integer and a vector and I'm getting errors
what is wrong with this code (this is only a part of it)
thanks,
Avi
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all ;
ENTITY example IS
PORT(
clk : IN std_logic
);
END example;
ARCHITECTURE arc_example OF example IS
CONSTANT matrix_depth : integer := 3;
subtype matrix_width is std_logic_vector(7 downto 0);
type matrix_type is array (matrix_depth downto 0) of matrix_width;
signal matrix : matrix_type;
subtype multiply_matrix_width is std_logic_vector(15 downto 0);
type multiply_type is array (matrix_depth downto 0) of multiply_matrix_width;
signal multiply : multiply_type;
BEGIN
-- FROM IEEE.NUMERIC_STD:
-- function "*" (L: INTEGER; R: SIGNED) return SIGNED;
-- Result subtype: SIGNED((R'LENGTH+R'LENGTH-1) downto 0)
-- Result: Multiplies a SIGNED vector, R, with an INTEGER, L. L is
-- converted to a SIGNED vector of SIZE R'LENGTH before
-- multiplication.
PROCESS (clk)
BEGIN
IF clk'event AND clk = '1' THEN
multiply(0) <= ((-1) * matrix(0) );
multiply(1) <= ((-1) * matrix(1) );
multiply(2) <= ((-1) * matrix(2) );
multiply(3) <= ((-1) * matrix(3) );
END IF;
END PROCESS;
END arc_example;
The errors that I receive from Synplicity:
--VHDL syntax check successful!
--Synthesizing work.example.arc_example
--@E:"C:\My Documents\temp.vhd":36:26:36:40|No matching overload for "*"
--@E:"C:\My Documents\temp.vhd":37:26:37:40|No matching overload for "*"
--@E:"C:\My Documents\temp.vhd":38:26:38:40|No matching overload for "*"
--@E:"C:\My Documents\temp.vhd":39:26:39:40|No matching overload for "*"
--Synthesis failed