Altera_Forum
Honored Contributor
13 years agoQuartus II Error Message VHDL Code
Sorry if this is in the wrong area but I am new here. I wrote a VHDL code and I keep getting the error:
Error (10327): VHDL error at week7.vhd(23): can't determine definition of operator ""+"" -- found 0 possible definitions and also this: Error (10327): VHDL error at week7.vhd(21): can't determine definition of operator ""-"" -- found 0 possible definitions have tried everything but can not seem to get my code to work. Here is the code:library ieee;
USE ieee.std_logic_1164.ALL;
use ieee.std_logic_arith;
use ieee.numeric_std.all;
use work.all;
entity week7 is
port (A, B: in std_logic_vector(0 to 3); --this gives me 2 inputs that are 4 bits
S : out std_logic_vector(0 to 4); -- this is the 5 bit result
F : in std_logic_vector(0 to 2)); --this is the 3 bit function select
end week7;
architecture behavior of week7 is
begin
process(A, B, F)
begin
if F = "000" then
S <= A;
elsif F = "001" then
S <= 111 - A;
elsif F = "010" then
S <= A + B;
elsif F= "011" then
S <= A - B;
elsif F = "100" then
S <= B;
elsif F = "101" then
S <= 111 - B;
elsif F = "110" then
S <= A + 1;
elsif F = "111" then
S <= A - 1;
end if;
end process;
end behavior;