DSP Product
Multiplication and division of scalars and non-scalars.
Description
Block DSP Product outputs the result of multiplication or division of two input data: two scalars, a scalar and a non-scalar, or two non-scalars having the same dimensions.
Block DSP Product performs scalar or matrix multiplication, depending on the value of the Multiplication parameters. The block accepts one or more inputs, depending on the Number of inputs parameters. The Number of inputs parameter also determines the operation to be performed for each input.
The block DSP Product can input any combination of scalars, vectors and matrices for which the operation to be performed has a mathematically defined result. The block performs the specified operations on the input data, then outputs the result.
Block DSP Product has two modes:
-
Element-wise mode - which processes non-scalar input data element-by-element
-
Matrix mode - which processes non-scalar input data in the form of matrices.
Element-Wise Mode
When you set Multiplication to Element-wise(.*)
, the Product block is in Element-wise mode, in which it handles the individual numeric elements of any non-scalar input data. In element-wise mode, the Product block can perform various multiplication, division and arithmetic inversion operations.
The value of the Number of inputs parameter determines both the number of inputs and whether each will be multiplied or divided to form the output. When the block DSP Product is in element-by-element mode and has only one input, it is functionally equivalent to a Product of Elements block. When the block has multiple inputs, any non-scalar inputs must have identical dimensions, and the block outputs a non-scalar value with those dimensions. To compute the output, the block first expands any scalar input to a non-scalar input that has the same dimensions as the non-scalar input.
Matrix Mode
When the value of the Multiplication parameters is Matrix(*)
, the unit DSP Product is in Matrix mode, in which it processes non-scalar input data as matrices. In this mode, the block DSP Product can invert a single square matrix or multiply and divide any number of matrices whose dimensions are defined mathematically.
The value of the Number of inputs parameters determines both the number of existing inputs and whether each input matrix will be multiplied or divided to form the output data. The syntax of Number of inputs is the same as in Element-wise mode. The difference between the modes is the type of multiplication and division that takes place.
Ports
Input
Port_1 - first input for multiplication or division
scalar
| vector
The first input for multiplication or division, provided as a scalar or vector.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
Port_N - Nth input for multiplication or division
scalar
| vector
Nth input for multiplication or division, provided as a scalar or vector.
Data types: Float16
, Float32
, Float64
, Int8
, Int16
, Int32
, Int64
, UInt8
, UInt16
, UInt32
, UInt64
, Bool
Parameters
Number of inputs - number and names of input ports
** (By default)
The number of input ports of the block is equal to the number of characters in this string. The characters become the names of these ports.
Multiplication - multiplication
Element-wise(.*) (by default)
| Matrix(*)
Specify whether the block performs Element-wise(.*)
or Matrix(*)
multiplication.