| 
		 | 	
  
Parameterized multiplier megafunction. Altera® recommends that you use lpm_mult to replace all other types of multiplier functions.
Altera also recommends instantiating this function as described in Using the MegaWizard® Plug-In Manager.
This topic contains the following information:
FUNCTION lpm_mult (dataa[(LPM_WIDTHA-1)..0], datab[(LPM_WIDTHB-1)..0], sum[(LPM_WIDTHS-1)..0], aclr, clock)
   WITH (LPM_WIDTHA, LPM_WIDTHB, LPM_WIDTHP, LPM_WIDTHS, LPM_REPRESENTATION, LPM_PIPELINE, LATENCY,
      INPUT_A_IS_CONSTANT, INPUT_B_IS_CONSTANT, USE_EAB, MAXIMIZE_SPEED,     
      DEDICATED_MULTIPLIER_CIRCUITRY, DEDICATED_MULTIPLIER_MIN_INPUT_WIDTH_FOR_AUTO,
      DEDICATED_MULTIPLIER_MIN_OUTPUT_WIDTH_FOR_AUTO)
   RETURNS (result[LPM_WIDTHP-1..0]);
The LATENCY parameter is provided only for backward compatibility. | 
 
COMPONENT lpm_mult
   GENERIC (LPM_WIDTHA: POSITIVE;
      LPM_WIDTHB: POSITIVE;
      --LPM_WIDTHS: POSITIVE;
      LPM_WIDTHS: NATURAL := 0;
      LPM_WIDTHP: POSITIVE;
      LPM_REPRESENTATION: STRING := "UNSIGNED";
      LPM_PIPELINE: INTEGER := 0;
      LPM_TYPE: STRING := "LPM_MULT";
      LPM_HINT: STRING := "UNUSED";
      DEDICATED_MULTIPLIER_CIRCUITRY: STRING := "AUTO";
      DEDICATED_MULTIPLIER_MIN_INPUT_WIDTH_FOR_AUTO: INTEGER := 0;
      DEDICATED_MULTIPLIER_MIN_OUTPUT_WIDTH_FOR_AUTO: INTEGER := 0;
   PORT (dataa: IN STD_LOGIC_VECTOR(LPM_WIDTHA-1 DOWNTO 0);
      datab: IN STD_LOGIC_VECTOR(LPM_WIDTHB-1 DOWNTO 0);
      aclr, clock: IN STD_LOGIC := '0';
	  clken: IN STD_LOGIC := '1';
      sum: IN STD_LOGIC_VECTOR(LPM_WIDTHS-1 DOWNTO 0) := (OTHERS => '0');
      result: OUT STD_LOGIC_VECTOR(LPM_WIDTHP-1 DOWNTO 0));
END COMPONENT;
LIBRARY lpm; USE lpm.lpm_components.all;
INPUT PORTS
| Port Name | Required | Description | Comments | 
|---|---|---|---|
dataa[] | 
    Yes | Multiplicand. | Input port LPM_WIDTHA wide. | 
  
datab[] | 
    Yes | Multiplier. | Input port LPM_WIDTHB wide. | 
  
sum[] | 
    No | Partial sum. | Input port LPM_WIDTHS wide. | 
  
clock | 
    No | Clock for pipelined usage. | The clock port provides pipelined operation for 
      the lpm_mult function. For LPM_PIPELINE values 
      other than 0 (default value), the clock port must be connected. | 
  
clken | 
    No | Clock enable for pipelined usage. | If omitted, the default is 1. | 
aclr | 
    No | Asynchronous clear for pipelined usage. | The pipeline initializes to an undefined (X) 
      logic level. The aclr port can be used at any time to reset 
      the pipeline to all 0s, asynchronously to the clock signal. The outputs are a consistent,
      but non-zero value. | 
  
OUTPUT PORTS
| Port Name | Required | Description | Comments | 
|---|---|---|---|
result[] | 
    Yes | result = dataa[] * datab[] 
      + sum. The product LSB is aligned with the sum LSB. | 
    Output port LPM_WIDTHP wide. If 
      LPM_WIDTHP < max (LPM_WIDTHA + LPM_WIDTHB, 
      LPM_WIDTHS) or (LPM_WIDTHA + LPM_WIDTHS), 
      only the LPM_WIDTHP MSBs are present. | 
  
| Parameter | Type | Required | Description | 
|---|---|---|---|
LPM_WIDTHA | 
    Integer | Yes | Width of the dataa[] port. | 
  
LPM_WIDTHB | 
    Integer | Yes | Width of the datab[] port. | 
  
LPM_WIDTHP | 
    Integer | Yes | Width of the result[] port. | 
  
LPM_WIDTHS | 
    Integer | Yes | Width of the sum[] port. Required 
      even if the sum port is not used. | 
  
LPM_REPRESENTATION | 
    String | No | Type of multiplication performed: "SIGNED", "UNSIGNED", or "UNUSED".  If omitted, the default is "UNSIGNED". The signed representation for all library of parameterized modules (LPM) megafunctions is two's complement. | 
  
LPM_PIPELINE | 
    Integer | No | Specifies the number of clock cycles of latency 
      associated with the result[] output. A value of zero (0) indicates 
      that no latency exists, and that a purely combinatorial function will be 
      instantiated. If the value of the LPM_PIPELINE parameter is greater than zero for the Mercury dedicated multiplier, one of the pipeline stages will always be placed on the outputs. If omitted, the default is 0 (non-pipelined). For Stratix and Stratix GX devices, if the design uses DSP blocks, you can increase the performance of the design when the value of the LPM_PIPELINE parameter is three or less. | 
  
LPM_HINT | 
    String | No | Allows you to assign 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. | 
INPUT_A_IS_CONSTANT | 
    String | No | Altera-specific 
      parameter. Values are "YES", "NO", 
      and "UNUSED". 
      If dataa[] is connected to a constant value, setting INPUT_A_IS_CONSTANT 
      to "YES" optimizes the multiplier for resource usage 
      and speed. If omitted, the default is "NO". | 
  
INPUT_B_IS_CONSTANT | 
    String | No | Altera-specific 
      parameter. Values are "YES", "NO", 
      and "UNUSED". 
      If datab[] is connected to a constant value, setting INPUT_B_IS_CONSTANT 
      to "YES" optimizes the multiplier for resource usage 
      and speed. The default is "NO". | 
  
USE_EAB | 
    String | No | 
	   Altera-specific parameter. Values are  If you wish to use this parameter when you instantiate the function in a Block Design File (.bdf), you must specify it by entering the parameter name and value manually with the 
Parameters tab (Symbol Properties Command) or the Parameters tab (Block Properties Command). You can also use this parameter name in a Text Design File (.tdf) or a Verilog Design File (.v). You must use the   | 
  
LATENCY | 
    Integer | No | Altera-specific 
      parameter. Same as LPM_PIPELINE. (This parameter is provided 
      only for backward compatibility. For all new designs, you should use the 
      LPM_PIPELINE parameter instead.) | 
  
MAXIMIZE_SPEED | 
    Integer | No | Altera-specific 
      parameter. You can specify a value between  For an   | 
  
DEDICATED_MULTIPLIER_CIRCUITRY | 
    String | No | Specifies whether to use dedicated multiplier circuitry. Values are  For Stratix and Stratix GX devices, the value of   | 
  
DEDICATED_MULTIPLIER_MIN_INPUT_WIDTH_FOR_AUTO | 
    Integer | No | If the DEDICATED_MULTIPLIER_CIRCUITRY parameter setting is "AUTO", this parameter specifies the minimum value of the LPM_WIDTHA and LPM_WIDTHB parameters in order for the multiplier to be built using dedicated circuitry. This parameter is available for Mercury, Stratix, and Stratix GX devices only. | 
  
DEDICATED_MULTIPLIER_MIN_OUTPUT_WIDTH_FOR_AUTO | 
    Integer | No | If the DEDICATED_MULTIPLIER_CIRCUITRY parameter setting is "AUTO", this parameter specifies the minimum value of the sum of the LPM_WIDTHA and LPM_WIDTHB parameters in order for the multiplier to be built using dedicated circuitry. This parameter is available for Mercury, Stratix, and Stratix GX devices only. | 
  
Specifying a value for MAXIMIZE_SPEED has an effect only if LPM_REPRESENTATION is set to "SIGNED". | 
 
| Inputs | Outputs | ||
|---|---|---|---|
dataa[LPM_WIDTHA-1..0] | 
    datab[LPM_WIDTHB-1..0] | 
    sum[LPM_WIDTHS-1..0] | 
    product[LPM_WIDTHP-1..0] | 
  
| a | b | s | LPM_WIDTHP most significant bits 
      of a * b + s | 
  
The following table summarizes the resource usage for an lpm_mult function used to implement 4-bit and 8-bit multipliers with LPM_PIPELINE = 0 and without the optional sum input. Logic cell usage scales linearly in proportion to the square of the input width.
| Design Goals | Design Results | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
 
      
  | 
	 
      
  | 
  
Numbers of shared expanders used are shown in parentheses ( ).
| This topic prints best in Landscape orientation. | 
| 
       - PLDWorld -  | 
    
| 
       
  | 
  
| Created by chm2web html help conversion utility. |