------------------------------------------------------------------------------- -- File: irgreater.vhd -- -- Project: DPF -- Date: 3/4/02 -- -- Purpose: N-bit comparitor, if the value of dataA is -- greater than the value of dataB the ouput is set to '1' -- -- Modified from the megafunction provided by altera -- -- Inputs: dataA -- input A -- dataB -- input B -- -- -- Outputs: AgeB -- return from the comparision -- -- valid if A >= B -- External Connections: -- ------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY lpm; USE lpm.lpm_components.all; entity irgreater IS generic(compareWidth : positive := 8); port ( dataA : in std_logic_vector (compareWidth-1 DOWNTO 0); dataB : in std_logic_vector (compareWidth-1 DOWNTO 0); AgeB : out STD_LOGIC ); END irgreater; ARCHITECTURE SYN OF irgreater IS component lpm_compare generic( lpm_width : NATURAL; one_input_is_constant : STRING; lpm_representation : STRING ); port( dataa : IN STD_LOGIC_VECTOR (compareWidth-1 DOWNTO 0); datab : IN STD_LOGIC_VECTOR (compareWidth-1 DOWNTO 0); AgeB : OUT STD_LOGIC ); end component; signal compareValue : STD_LOGIC; begin AgeB <= compareValue; lpm_compare_component : lpm_compare generic map( LPM_WIDTH => compareWidth, ONE_INPUT_IS_CONSTANT => "NO", LPM_REPRESENTATION => "UNSIGNED" ) port map( dataa => dataA, datab => dataB, AgeB => compareValue ); END SYN;