Math Function

Perform mathematical function (HDL Coder)

Description

The Math Function block is available with Simulink®.

For information about the simulation behavior and block parameters, see Math Function.

HDL Architecture

conj

ArchitectureDescription
ComplexConjugateCompute complex conjugate. See Math Function in the Simulink documentation.

hermitian

ArchitectureDescription
HermitianCompute hermitian. See Math Function in the Simulink documentation.

reciprocal

This block has multi-cycle implementations that introduce additional latency in the generated code. To see the added latency, view the generated model or validation model. See Generated Model and Validation Model.

ArchitectureParametersAdditional cycles of latencyDescription
Math (default)
Reciprocal
None0Compute reciprocal as 1/N, using the HDL divide (/) operator to implement the division.
ReciprocalRsqrtBasedNewtonIterations

Signed input: Iterations + 5

Unsigned input: Iterations + 3

Use the iterative Newton method. Select this option to optimize area.

The default value for Iterations is 3.

The recommended value for Iterations is from 2 through 10. If Iterations is outside the recommended range, HDL Coder™ generates a message.

 
ReciprocalRsqrtBasedNewtonSingleRateIterations

Signed input: (Iterations * 4) + 8

Unsigned input: (Iterations * 4) + 6

Use the single rate pipelined Newton method. Select this option to optimize speed, or if you want a single rate implementation.

The default value for Iterations is 3.

The recommended value for Iterations is from 2 through 10. If Iterations is outside the recommended range, the coder generates a message.

 
 

The Newton-Raphson iterative method:

xi+1=xif(xi)f'(xi)=xi(1.50.5axi2)

ReciprocalRsqrtBasedNewton and ReciprocalRsqrtBasedNewtonSingleRate implement the Newton-Raphson method with:

f(x)=1x21

transpose

ArchitectureDescription
TransposeCompute array transpose. See Math Function in the Simulink documentation.

HDL Block Properties

ConstrainedOutputPipeline

Number of registers to place at the outputs by moving existing delays within your design. Distributed pipelining does not redistribute these registers. The default is 0. See also ConstrainedOutputPipeline.

InputPipeline

Number of input pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is 0. See also InputPipeline.

OutputPipeline

Number of output pipeline stages to insert in the generated code. Distributed pipelining and constrained output pipelining can move these registers. The default is 0. See also OutputPipeline.

Complex Data Support

The conj, hermitian, and transpose functions support complex data.

Restrictions

When you use a reciprocal implementation:

  • Input must be scalar and must have integer or fixed-point (signed or unsigned) data type.

  • The output must be scalar and have integer or fixed-point (signed or unsigned) data type.

  • Only the Zero rounding mode is supported.

  • The Saturate on integer overflow option on the block must be selected.

Was this topic helpful?