B21hasni
Junior Member level 3
Error (10327): VHDL error at ALU.vhd(21): can't determine definition of operator ""+"
when I compile the program below
I got that error
when I compile the program below
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; package ALU is function addition (A,B: bit_vector) return bit_vector; function subtraction (A,B: bit_vector) return bit_vector; function multiplication (A,B: bit_vector) return bit_vector; function pass_A (A: bit_vector) return bit_vector; function Logical_AND (A,B: bit_vector) return bit_vector; function Logical_OR (A,B: bit_vector) return bit_vector; function shift_R (A: bit_vector) return bit_vector; function shift_L (A: bit_vector) return bit_vector; end ALU; package body ALU is function addition (A,B: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := A+B; return Y; end function; function subtraction (A,B: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := A-B; return Y; end function; function multiplication (A,B: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := A*B; return Y; end function; function pass_A (A: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := A; return Y; end function; function Logical_AND (A,B: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := A AND B; return Y; end function; function Logical_OR (A,B: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := A OR B; return Y; end function; function shift_R (A: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := '0'& Y(15 downto 1) ; return Y; end function; function shift_L (A: bit_vector) return bit_vector is variable Y: bit_vector (15 downto 0); begin Y := Y(14 downto 0)&"0"; return Y; end function; end package body;
I got that error
what is the error in that code ???Error (10327): VHDL error at ALU.vhd(21): can't determine definition of operator ""+"" -- found 0 possible definitions