Megafunctions

altfp_mult (Floating Point Multiplier) Megafunction



Parameterized floating point multiplier megafunction. Altera® recommends that you use the altfp_mult function instead of any other type of floating point multiplier function.

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 altfp_mult (clock, clk_en, aclr, dataa[WIDTH_EXP+WIDTH_MAN..0], 
      datab[WIDTH_EXP+WIDTH_MAN..0] )
   WITH (WIDTH_EXP, WIDTH_MAN, DEDICATED_MULTIPLIER_CIRCUITRY )
   RETURNS (result[WIDTH_EXP+WIDTH_MAN..0], overflow, underflow, zero, denormal,
      indefinite, nan );


VHDL Component Declaration:

COMPONENT altfp_mult
   GENERIC 
      (WIDTH_EXP                       : INTEGER := 8;
      WIDTH_MAN                        : INTEGER := 23;
      DEDICATED_MULTIPLIER_CIRCUITRY   : STRING  := "AUTO";
      LPM_HINT                         : STRING  := "UNUSED";
      LPM_TYPE                         : STRING  := "ALTFP_MULT");

    PORT (clock                           : IN STD_LOGIC;
         clk_en                           : IN STD_LOGIC := '1';
         aclr                             : IN STD_LOGIC := '0';
         dataa, datab                     : IN STD_LOGIC_VECTOR (WIDTH_EXP + WIDTH_MAN DOWNTO 0);
         result                           : OUT STD_LOGIC_VECTOR (WIDTH_EXP + WIDTH_MAN DOWNTO 0);
         overflow, underflow, zero,
            denormal, indefinite, nan     : OUT STD_LOGIC;);

END COMPONENT;

 

VHDL LIBRARY-USE Declaration

LIBRARY altera_mf;
USE altera_mf.altera_mf_components.all;


Port Descriptions:

INPUT PORTS

Port Name Required Description Comments
clock Yes Clock input to the multiplier.  
clk_en No Clock enable for the multiplier.  
aclr No Asynchronous clear for the multiplier.  
dataa Yes Data input to the multiplier. Input port [WIDTH_EXP + WIDTH_MAN DOWNTO 0] wide.
datab Yes Data input to the multiplier. Input port [WIDTH_EXP + WIDTH_MAN DOWNTO 0] wide.

OUTPUT PORTS

Port Name Required Description Comments
result Yes Multiplier output port. Output port [WIDTH_EXP + WIDTH_MAN DOWNTO 0] wide.
overflow No Overflow port for the multiplier.  
underflow No Underflow port for the multiplier.  
zero No Zero port for the multiplier.  
denormal No Denormal port for the multiplier.  
indefinite No Indefinite port for the multiplier.  
nan No Nan port for the multiplier.  


Parameter Descriptions:

Parameter Type Required Comments
WIDTH_EXP Integer No Specifies the value of the exponent. If omitted, the default is "8". The Bias of the exponent is always set to 2 * WIDTH_EXP - 1 (i.e. -127 for single precision floating point format and -1023 for double precision floating point format). WIDTH_EXP must be 8 for single precision floating point format or a minimum of 11 for double precision and single extended precision floating point format. WIDTH_EXP must less than WIDTH_MAN. The sum of WIDTH_EXP and WIDTH_MAN must be less than 64.
WIDTH_MAN Integer No Specifies the value of the mantissa. If omitted, the default is "23". When WIDTH_EXP is 8 and the floating point format is single precision, the WIDTH_MAN value must be 23. Otherwise, the value of WIDTH_MAN must be a minimum of 31. The WIDTH_MAN value must always be greater than the WIDTH_EXP value. The sum of WIDTH_EXP and WIDTH_MAN must be less than 64.
DEDICATED_MULTIPLIER_CIRCUITRY String No Specifies whether to use dedicated multiplier circuitry. Values are "AUTO", "YES", or "NO". If omitted, the default is AUTO. If a device does not have dedicated multiplier circuitry, the DEDICATED_MULTIPLIER_CIRCUITRY parameter has no effect and defaults to NO.
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.


Truth Table/Functionality:

Inputs Outputs
dataa[] datab[] result[] overflow underflow zero denormal indefinite nan
Normal Normal Normal 0 0 0 0 0 0
Normal Normal Denormal 0 1 0 1 0 0
Normal Normal Infinity 1 0 0 0 0 0
Normal Normal Zero 0 1 1 0 0 0
Normal Denormal don't care 0 0 0 0 1 0
Denormal Normal don't care 0 0 0 0 1 0
Denormal Denormal don't care 0 0 0 0 1 0
Zero Normal Zero 0 0 1 0 0 0
Zero Denormal Zero 0 0 1 0 0 0
Zero Zero Zero 0 0 1 0 0 0
Normal Zero Zero 0 0 1 0 0 0
Denormal Zero Zero 0 0 1 0 0 0
Infinity Normal Infinity 1 0 0 0 0 0
Infinity Denormal Infinity 1 0 0 0 0 0
Infinity Infinity Infinity 1 0 0 0 0 0
Infinity Zero NaN 0 0 0 0 0 1
Normal Infinity Infinity 1 0 0 0 0 0
Denormal Infinity Infinity 1 0 0 0 0 0
Zero Infinity NaN 0 0 0 0 0 0
NaN Normal NaN 0 0 0 0 0 1
NaN Denormal NaN 0 0 0 0 0 1
NaN Zero NaN 0 0 0 0 0 1
NaN Infinity NaN 0 0 0 0 0 1
NaN Nan NaN 0 0 0 0 0 1
Normal NaN NaN 0 0 0 0 0 1
Denormal NaN NaN 0 0 0 0 0 1
Zero NaN NaN 0 0 0 0 0 1
Infinity NaN NaN 0 0 0 0 0 1


Resource Usage:

Design Design Results
Device Family Precision Type Dedicated Multiplier Circuitry
Stratix
Note (1)
Single Yes
  Single No
  Double Yes
  Double No
APEX 20K
Note (2)
Single Not Applicable
  Double Not Applicable
fMAX Logic Cells DSP Blocks 9-Bit Elements
97.59 MHz
 
627 8
87.03 MHz 1614 0
70.20 MHz 1450 26
62.51 MHz 5613 0
57.37 MHz
 
1659 0
35.94 MHz 5763 0


Floating Point Format:

Location Label Description Bits Position
Sign Sign bits of a floating point number. WIDTH_EXP + WIDTH_MAN
Exponent Exponent bits of a floating point number. (WIDTH_EXP + WIDTH_MAN - 1) DOWNTO WIDTH_MAN
Mantissa Mantissa bits of a floating bit number. (WIDTH_MAN - 1) DOWNTO 0


Example:

Location Single Precision Double Precision Single Extended Precision
WIDTH_EXP = 8
WIDTH_MAN = 23
WIDTH_EXP = 11
WIDTH_MAN = 52
WIDTH_EXP = 11
WIDTH_MAN = 31
WIDTH_EXP = 20
WIDTH_MAN = 38
Sign dataa[31] dataa[63] dataa[42] dataa[58]
datab[31] datab[63] datab[42] dataa[58]
result[31] result[63] result[42] result[58]
Exponent dataa[30..23] dataa[62..52] dataa[41..31] dataa[57..38]
datab[30..23] datab[62..52] datab[41..31] datab[57..38]
result[30..23] result[62..52] result[41..31] result[57..38]
Mantissa dataa[22..0] dataa[51..0] dataa[30..0] dataa[37..0]
datab[22..0] datab[51..0] datab[30..0] datab[37..0]
result[22..0] result[51..0] result[30..0] result[37..0]


NOTE This topic prints best in Landscape orientation.

Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.