Calculate square root, signed square root, or reciprocal of square root (HDL Coder)
The Sqrt block is available with Simulink®.
For information about the simulation behavior and block parameters, see 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 | Parameter | Additional cycles of latency | Description |
---|---|---|---|
SqrtFunction (default) | None | 0 | Use a bitset shift/addition algorithm. The |
SqrtBitset | UseMultiplier | 0 | Algorithm depends on the
|
SqrtNewton | Iterations | Iterations + 3 | Use the iterative Newton method. Select this option to optimize area. The default value for The recommended value for |
SqrtNewtonSingleRate | Iterations | (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 The
recommended value for |
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 iterations for SqrtNewton
or SqrtNewtonSingleRate
implementation.
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 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.
Select algorithm for SqrtBitset
implementation.
The default is off
.
Input must be an unsigned scalar value.
Output is a fixed-point scalar value.