This analyzes:
library ieee;
use ieee.std_logic_1164.all;
-- library ieee; -- successive library clause has no effect
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity alu is
port (
a: in std_logic_vector (15 downto 0);
b: in std_logic_vector (15 downto 0);
funct: in std_logic;
op: in std_logic_vector (1 downto 0);
result: out std_logic_vector (15 downto 0)
);
end alu;
architecture behavioral of alu is
begin
process (op, funct)
begin
case op is
when "00" =>
result <= a+b;
when "01" =>
result <= a-b;
when others =>
case funct is
when '0' => result <= a+b; -- "0"
when '1' => result <= a-b; -- "1"
when others => null;
end case;
end case; -- `end case;
end process;
end behavioral;
Type std_logic has enumerations using character literals and of itself is a scalar, not eligible to have a string assigned to funct
. From the std_logic_1164 package declaration:
-------------------------------------------------------------------
TYPE std_ulogic IS ( 'U', -- Uninitialized
'X', -- Forcing Unknown
'0', -- Forcing 0
'1', -- Forcing 1
'Z', -- High Impedance
'W', -- Weak Unknown
'L', -- Weak 0
'H', -- Weak 1
'-' -- Don't care
);
-------------------------------------------------------------------
and:
-------------------------------------------------------------------
SUBTYPE std_logic IS resolved std_ulogic;
-------------------------------------------------------------------
As mentioned in the comment to your question the grave accent character shouldn't be in front of the second end case;
.