------------------------------------------------------------------------------- -- File: irlesser.vhd -- -- Project: DPF -- Date: 3/4/02 -- -- Purpose: N-bit comparitor, if the value of dataA is -- less 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: AleB -- return from the comparision -- -- valid if A <= B -- External Connections: -- ------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY irlesser IS generic(compareWidth : positive := 8); PORT ( dataA : IN STD_LOGIC_VECTOR (compareWidth-1 DOWNTO 0); dataB : IN STD_LOGIC_VECTOR (compareWidth-1 DOWNTO 0); AleB : OUT STD_LOGIC ); END irlesser; ARCHITECTURE SYN OF irlesser 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); AleB : OUT STD_LOGIC ); end component; signal compareValue : STD_LOGIC ; begin AleB <= 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, AleB => compareValue ); END SYN;