Reciprocal Sqrt

Calculate square root, signed square root, or reciprocal of square root (HDL Coder)

Description

The Reciprocal Sqrt block is available with Simulink®.

For information about the simulation behavior and block parameters, see Reciprocal Sqrt.

HDL Architecture

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.

ArchitectureAdditional cycles of latencyDescription
SqrtFunction (default)0

Use a bitset shift/addition algorithm.

The SqrtFunction architecture is equivalent to the SqrtBitset architecture with UseMultiplier set to off.

RecipSqrtNewtonIterations + 2

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

RecipSqrtNewtonSingleRate(Iterations * 4) + 5

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

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.

Iterations

Number of iterations for Newton method. The default is 3.

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.

Restrictions

  • In the Block Parameters dialog box, in the Algorithm tab, for Method, you must select Newton-Raphson.

  • In the HDL Block Properties dialog box, for Architecture, you must select either RecipSqrtNewtonSingleRate or RecipSqrtNewton.

  • Input must be an unsigned scalar value.

  • Output is a fixed-point scalar value.

Was this topic helpful?