Megafunction

lpm_or (OR Gate) Megafunction



Parameterized OR gate megafunction. Altera® recommends using an OR primitive or operator rather than lpm_or for easier implementation and to improve compilation time. However, lpm_or may be useful if you need parameterized inputs.

Altera also recommends instantiating this function as described in Using the MegaWizard® Plug-In Manager.

This topic contains the following information:

 

AHDL Function Prototype (port name and order also apply to Verilog HDL):

FUNCTION lpm_or (data[LPM_SIZE-1..0][LPM_WIDTH-1..0]
   WITH (LPM_WIDTH, LPM_SIZE)
   RETURNS (result[LPM_WIDTH-1..0];

 

VHDL Component Declaration:

COMPONENT lpm_or
   GENERIC (LPM_WIDTH: POSITIVE;
      LPM_SIZE: POSITIVE;
      LPM_TYPE: STRING := "LPM_OR";
      LPM_HINT: STRING := "UNUSED");
   PORT (data: IN STD_LOGIC_2D(LPM_SIZE-1 DOWNTO 0, LPM_WIDTH-1 DOWNTO 0);
      result: OUT STD_LOGIC_VECTOR(LPM_WIDTH-1 DOWNTO 0));
END COMPONENT;

 

VHDL LIBRARY-USE Declaration

LIBRARY lpm;
USE lpm.lpm_components.all;

 

Port Descriptions:

INPUT PORTS

Port Name Required Description Comments
data[][] Yes Data input to the OR gates. Input port LPM_SIZE x LPM_WIDTH wide. Two-dimensional bus ports are not supported in Verilog HDL.

OUTPUT PORTS

Port Name Required Description Comments
result[] Yes Result of OR operators. Output port LPM_WIDTH wide.

 

Parameter Descriptions:

Parameter Type Required Description
LPM_WIDTH Integer Yes Width of the data[] and result[] ports. Number of OR gates.
LPM_SIZE Integer Yes Number of inputs to each OR gate. Number of input buses.
LPM_HINT String No Allows you to specify Altera-specific parameters in VHDL Design Files (.vhd). The default is "UNUSED".
LPM_TYPE String No Identifies the library of parameterized modules (LPM) entity name in VHDL Design Files.

 

Truth Table/Functionality:

Each lpm_or function defines LPM_WIDTH OR gates. Each OR gate has the following function:

Inputs Output
DATA[LPM_SIZE-1..0]_[LPM_WIDTH-1] RESULT[LPM_WIDTH-1]
1XXX... 1
X1XX... 1
XX1X... 1
... ...
0000... 0

 

Resource Usage:

Uses one logic cell per output.

NOTE This topic prints best in Landscape orientation.


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.