Main Content

Normalized Reciprocal HDL Optimized

Computes normalized reciprocal and generates optimized HDL code

Since R2020a

  • Normalized Reciprocal HDL Optimized block

Libraries:
Fixed-Point Designer HDL Support / Math Operations

Description

The Normalized Reciprocal HDL Optimized block computes the normalized reciprocal of u, returned as y and e such that 0.5 < |y| ≤ 1 and 2ey = 1/u.

  • If u = 0 and u is a fixed-point or scaled-double data type, then y = 2 – eps(y) and e = 2nextpow2(w)w + f, where w is the word length of u and f is the fraction length of u.

  • If u = 0 and u is a floating-point data type, then y = Inf and e = 1.

Examples

Ports

Input

expand all

Value to take the normalized reciprocal of, specified as a real scalar.

Slope-bias representation is not supported for fixed-point data types.

Data Types: single | double | fixed point

Whether input is valid, specified as a Boolean scalar. This control signal indicates when the data from the u input port is valid. When this value is 1 (true), the block captures the value at the u input port. When this value is 0 (false), the block ignores the input samples.

Data Types: Boolean

Output

expand all

Normalized reciprocal that satisfies 0.5 < |y| ≤ 1 and 2ey = 1/u, returned as a scalar.

  • If the input at port u is a signed fixed-point or scaled-double data type with word length w, then y is a signed fixed-point or scaled-double data type with word length w and fraction length w – 2.

  • If the input at port u is an unsigned fixed-point or scaled-double data type with word length w, then y is an unsigned fixed-point or scaled-double data type with word length w and fraction length w – 1.

  • If the input at port u is a double, then y is a double.

  • If the input at port u is a single, the y is a single.

Data Types: single | double | fixed point

Exponent that satisfies 0.5 < |y| ≤ 1 and 2ey = 1/u, returned as an integer scalar.

Data Types: int32

Since R2024b

Whether the values at the y and e output ports are the result of a division by zero operation, returned as a Boolean scalar. When the value of this signal is 1 (true), the corresponding output values at the y and e ports are the result of division by zero. When the value of this signal is 0 (false), the corresponding output values at the y and e ports are the result of division by a non-zero value.

Whether the divisor u is zero, returned as a Boolean scalar. When the value of this signal is 1 (true), the input at the u port is zero, resulting in a divide by zero operation. When the value of this signal is 0 (false), the input at the u port is a non-zero value.

Dependencies

Tips

Data Types: Boolean

Whether the output data is valid, returned as a Boolean scalar. When the value of this control signal is 1 (true), the block has successfully computed the outputs at ports y and e. When this value is 0 (false), the output data is not valid.

Data Types: Boolean

Parameters

expand all

Since R2024b

Select this parameter to show the divideByZero port.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: dbzPort
Values: 0 (false) (default) | 1 (true)
Data Types: logical

Example: set_param(gcb,"dbzPort",1)

Since R2024b

Automatically select CORDIC maximum shift value based on input word length. When this parameter is selected, the default CORDIC maximumShiftValue is equal to wl - 1, where wl = u.WordLength + ~issigned(u).

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: autoMaximumShiftVal
Values: on (default) | off
Data Types: char | string

Example: set_param(gcb,"autoMaximumShiftVal","off")

Since R2024b

Maximum shift value of hyperbolic vectoring CORDIC, specified as a positive integer-valued scalar. The default value for this parameter is wl - 1, where wl = u.WordLength + ~issigned(u).

Dependencies

To enable this parameter, deselect the Automatically select CORDIC maximum shift value based on input word length parameter.

Tips

See Customizable Pipelining for more information.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: maximumShiftValue
Values: 10 (default) | positive integer-valued scalar
Data Types: char | string

Example: set_param(gcb,"maximumShiftValue","10")

Since R2024b

Number of CORDIC iterations to perform per pipeline stage, specified as a positive integer-valued scalar.

Tips

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

To get the block parameter value programmatically, use the get_param function.

Parameter: nIterPerReg
Values: 1 (default) | positive integer-valued scalar
Data Types: char | string

Example: set_param(gcb,"nIterPerReg","2")

More About

Algorithms

expand all

Extended Capabilities

Version History

Introduced in R2020a

expand all

See Also

Functions

Blocks