Professional Documents
Culture Documents
ALU CODE and TEST BENCH
ALU CODE and TEST BENCH
ALU CODE and TEST BENCH
-- Company:
-- Engineer:
--
-- Design Name:
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--use IEEE.NUMERIC_STD.ALL;
--library UNISIM;
--use UNISIM.VComponents.all;
entity ALU is
ALUS : in STD_LOGIC;
end ALU;
begin
begin
case ALUC is
end case;
end process;
TEST BENCH-
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Design Name:
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Additional Comments:
--
----------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
--USE ieee.numeric_std.ALL;
ENTITY ALU_TB IS
END ALU_TB;
COMPONENT ALU IS
PORT(
ALUS : IN std_logic;
END COMPONENT;
--Inputs
--Outputs
signal Zero : std_logic;
BEGIN
D1 => D1,
D2 => D2,
ALU_R=> ALU_R,
-- Stimulus process
stim_proc: process
begin
D1 <= X"00000001";
D2 <= X"00000002";
ALUSr<= '0';
D1 <= X"00000003";
D2 <= X"00000007";
D1 <= X"00000003";
D2 <= X"0000000A";
D1 <= X"0000000A";
D2 <= X"00000003";
D1 <= X"0000000A";
D2 <= X"00000003";
D2 <= X"0000000A";
wait;
end process;
end behavior;