| Motorola DSP Developer's Kit |
| Motorola DSP Developer's Kit | ![]() |
X = mot###_max(X, Y)
This function returns a vector the same size as input vectors X and Y with the largest elements taken from vector X or Y,
Input/Output
Input: Vector X (real data), vector Y (real data)
Output: Vector X (largest element taken from X or Y)
Algorithm
#define IN1 x:$0
#define IN2 y:$0
#define OUT x:$0
MaxValue = X[0];
for(i=1; i<size; i++)
{
if(X[i] < Y[i])
{
X[i] = Y[i];
}
}
Memory & Register
X memory IN1 start address of location of input real vector X
Y memory IN2 start address of location of input real vector Y
X memory OUT start address of location of output real vector
Register R7 store number of items in the input array
Status Register
The assembly function max-2r.asm does not explicitly set any status registers/bits during the function execution.
Data Size Limit
The length of input vectors can't be larger than the continuous available data memory size.
Data Range Limit
Input data vector range [-1.0, +1.0]
Precision
In the case of DSP563, precision is 23 bits.
In the case of DSP566, precision is 15 bits.
Performance Limit
| max-1c.asm | max-2c.asm | |