Professional Documents
Culture Documents
-----
--
-- Title : ALU_function
-- Design : de1
-- Author : nguyenduytan1909@hotmail.com
-- Company : home
--
-------------------------------------------------------------------------
------
--
-- File : ALU_function.vhd
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity ALU_function is
port(
cin : in STD_LOGIC;
a : in STD_LOGIC_VECTOR(7 downto 0);
b : in STD_LOGIC_VECTOR(7 downto 0);
sel : in STD_LOGIC_VECTOR(3 downto 0);
y : out STD_LOGIC_VECTOR(7 downto 0)
);
end ALU_function;
process(sel,a,b,cin)
begin
w1<=hamlogic(a,b,sel(2 downto 0));
w2<=hamsohoc(a,b,sel(2 downto 0),cin);
y<=hammux(w1,w2,sel(3));
end process;
end ALU_function;