DSP Builder for Intel® FPGAs (Advanced Blockset): Handbook

ID 683337
Date 12/12/2022

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

15.4.36. Math

The Math block applies a mathematical operation to its floating-point inputs and outputs the floating-point result. A mask parameter popup menu selects the required elementary mathematical function that DSP Builder applies.
Table 212.  Functions for the Math Block
Function Description
exp(x)  (1) e raised to the exponent x.
exp2(x) 2 raised to the exponent x.
exp10(x) 10 raised to the exponent x.
expm1(x) exp(x) – 1.
inverse(x) The reciprocal of x. For Floating-point rounding, select either correct or faithful.
hypot(x,y) Hypotenuse of right-angled triangle with other two sides length x and y.
hypot3d The Euclidean norm of a vector in a three-dimensional space.
log(x)  (1) Natural logarithm.
log2(x) Logarithm of x to the base 2.
log10(x) Logarithm of x to the base 10.
log1p(x) log(x+1).
pow(x,y) x raised to the power of y.
powr(x,y) x raised to the power of y, where I is non-negative.
mod(x,y) (x – n × y) where n = y/x rounded toward zero.
  1. For single-precision input and designs targeting any device with a floating-point DSP block, the block uses a mixture of resources including the DSP blocks in floating-point mode. This implementation uses fewer ALMs at the expense of more DSP blocks.

Table 17–66 shows the functions for the Math block.

The Function mask parameter selects one of five elementary functions. The number of input ports on the block change as required by the semantics of the function that you select:

  • One-input function: exp(x), exp2(x), exp10(x), expm1(x), log(x), log2(x), log10(x),log1p(x), inverse(x)
  • Two-input functions: hypot(x,y), mod(x,y), pow(x,y), powr(x,y)
  • Three input function: hypot3d(x,y,z)
    Table 213.  Port Interface for the Math Block
    Signal Direction Type Description Vector Data Support Complex Data Support
    x Input Single or double Operand 1 Yes No
    y Input Single or double Operand 2

    (hypot, mod, pow, and powr only)

    Yes No
    z Input Single or double Hypot3 only. Yes No
    q Output Single or double Result Yes No