Calculate square root, signed square root, or reciprocal of square root (HDL Coder)
The Reciprocal Sqrt block is available with Simulink®.
For information about the simulation behavior and block parameters, see Reciprocal Sqrt.
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.
Architecture | Additional cycles of latency | Description |
---|---|---|
SqrtFunction (default) | 0 | Use a bitset shift/addition algorithm. The |
RecipSqrtNewton | Iterations + 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. |
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.
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.
Number of iterations for Newton method. The default is 3.
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.
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.