--The IEEE standard 1164 package, declares std_logic, rising_edge(), etc.
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity eALU16 is
port(
ipA: in std_logic_vector(0 to 15);
ipB: in std_logic_vector(0 to 15);
ipALUOp: in std_logic_vector(0 to 2);
opZero: out std_logic;
opResult: in std_logic_vector(0 to 15)
);
end eALU16;
architecture aALU16 of eALU16 is
begin
case ipALUOp is
when "000" => opResult <= ipA + ipB;
when "001" => opResult <= ipA - ipB;
when "010" => opResult <= ipA and ipB;
when "011" => opResult <= ipA or ipB;
when "100" => opResult <= not ipA + '1';
when "101" => opResult <= not ipB + '1';
when "110" => opResult <= 1 when (ipA < ipB) else 0;
when others => null;
end case;
opZero <= '1' when (opResult = "0000000000000000" else '0';
end aALU16;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
entity eALU16 is
port(
ipA: in std_logic_vector(0 to 15);
ipB: in std_logic_vector(0 to 15);
ipALUOp: in std_logic_vector(0 to 2);
opZero: out std_logic;
opResult: in std_logic_vector(0 to 15)
);
end eALU16;
architecture aALU16 of eALU16 is
begin
case ipALUOp is
when "000" => opResult <= ipA + ipB;
when "001" => opResult <= ipA - ipB;
when "010" => opResult <= ipA and ipB;
when "011" => opResult <= ipA or ipB;
when "100" => opResult <= not ipA + '1';
when "101" => opResult <= not ipB + '1';
when "110" => opResult <= 1 when (ipA < ipB) else 0;
when others => null;
end case;
opZero <= '1' when (opResult = "0000000000000000" else '0';
end aALU16;