Real Reciprocal HDL Optimized
Libraries:
Fixed-Point Designer HDL Support /
Math Operations
Description
The Real Reciprocal HDL Optimized block computes 1/u
,
where u
is a real scalar.
Examples
Limitations
Data type override is not supported for the Real Reciprocal HDL Optimized block.
Ports
Input
u — Value to take reciprocal of
real scalar
Value to take the reciprocal of, specified as a real scalar.
Slope-bias representation is not supported for fixed-point data types.
Data Types: single
| double
| fixed point
validIn — Whether input is valid
Boolean
scalar
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
y — Reciprocal
real scalar
Reciprocal, returned as a real scalar with the data type specified by the Output datatype parameter.
Data Types: single
| double
| fixed point
validOut — Whether output data is valid
Boolean
scalar
Whether 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 output at port y
. When this value is
0
(false
), the output data is not
valid.
Data Types: Boolean
Parameters
Output datatype — Data type of output
fixdt(1,18,10)
(default) | single
| fixdt(1,16,0)
| <data type expression>
Data type of the output y
, specified as
fixdt(1,18,10)
, single
,
fixdt(1,16,0)
, or as a user-specified data type expression. The
type can be specified directly, or expressed as a data type object, such as
Simulink.NumericType
.
Programmatic Use
Block Parameter:
OutputType |
Type: character vector |
Values:
'fixdt(1,18,10)' | 'single' |
'fixdt(1,16,0)' | '<data type
expression>' |
Default:
'fixdt(1,18,10)' |
Algorithms
Division by Zero Behavior
For fixed-point input u
, the Real Reciprocal HDL
Optimized block wraps on overflow for division by zero. The behavior for
fixed-point division by zero is summarized in the table below.
Wrap Overflow | Saturate Overflow |
---|---|
0/0 = 0 | 0/0 = 0 |
1/0 = 0 | 1/0 = upper bound |
-1/0 = 0 | -1/0 = lower bound |
For floating-point inputs, the Real Reciprocal HDL Optimized block follows IEEE® Standard 754.
How to Interface with the Real Reciprocal HDL Optimized Block
Because of its fully pipelined nature, the Real Reciprocal HDL Optimized
block is able to accept input data on any cycle, including consecutive clock cycles. To send
input data to the block, the validIn
signal must be true. When the block
has finished the computation and is ready to send the output, it will change
validOut
to true for one clock cycle. For inputs set of consecutive
cycles, validOut
will also be set to true on consecutive cycles.
The latency is defined from the input to the corresponding output. For example in the
figure below, from In1
to Out1
, In2
to Out2
, In3
to Out3
, etc.
The latency depends on the input data type, as summarized in the table.
Input Type | Latency |
---|---|
| nextpow2(u.WordLength) + 1 + u.WordLength + 2 - issigned(u) +
7 |
Scaled double | u.WordLength + 2 - issigned(u) + 7 |
Floating point | 7 |
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Slope-bias representation is not supported for fixed-point data types.
HDL Code Generation
Generate Verilog and VHDL code for FPGA and ASIC designs using HDL Coder™.
Supports fixed-point data types only.
Version History
Introduced in R2021a
See Also
Blocks
Functions
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)