----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity compare1 is
generic (compWidth : natural := 8);
port(
clk : in std_logic;
rst : in std_logic;
comp_in1 : in std_logic_vector (compWidth-1 downto 0);
comp_in2 : in std_logic_vector (compWidth-1 downto 0);
comp_out1 : out std_logic;
comp_out2 : out std_logic;
comp_out3 : out std_logic;
comp_out4 : out std_logic;
);
end compare1;
architecture Behavioral of compare1 is
begin
comp_out1 <= '1' when comp_in1 = comp_in2 else '0';
comp_out2 <= '1' when (comp_in1
comp_in2)
comp_out3 <= '1'
comp_out4 <= '1'
end Behavioral;
----------------------------------------------------------------------------------
(1) Pedroni, V., Circuit Design with VHDL, The MIT Press, 2004.
No comments:
Post a Comment