Allowable Arithmetic Services

For all calculations that occur in ASCET, there is a corresponding arithmetic service, which the user can customize and optimize to suit specific needs.

The table below lists all arithmetic services that are understood by ASCET, as well as the corresponding number and the type of the parameters (O = operation; 1,2,3 = operand1, 2, 3; R = result) and the meaning of the function. In addition, it specifies a standard function definition.

Note

The number and order of the parameters in the table is the default. In principle, kind, number and order of the parameters is not restricted (as long as the C syntax is correct), you can add more parameters for special purposes.

Function Key

Standard Function Definitiona

Parameters1

Meaning

abs|*|*

abs_%t1%_%tr% (%i1%)

O|1|R

Deriving the absolute value

neg|*|*

neg_%t1%_%tr% (%i1%)

O|1|R

Negating a value

+|*|*|*

add_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Addition of two values

+l|*|*|*

addl_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Addition of two values with saturationb

-|*|*|*

sub_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Subtraction of two values

-l|*|*|*

subl_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Subtraction of values with saturationb

*|*|*|*

mul_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Multiplication of two values

*l|*|*|*

mull_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Multiplication of values with saturationb

/|*|*|*

div_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Division of two values

/l|*|*|*

divl_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Division of two values with saturationb

%|*|*|*

mod_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|R

Modulo calculation of two values

%l|*|*|*

modl_%t1%%t2%_%tr%(%i1%, %i2%)

O|1|2|3|R

Modulo calculation of two values with saturationb

*>|*|*|*|*

mul_r_%t1%%t2%_%tr%(%i1%, %i2%, %i3%)

O|1|2|3|R

Multiplication of two values with subsequent right shift

*>l|*|*|*|*

mul_rl_%t1%%t2%_%tr%(%i1%, %i2%, %i3%)

O|1|2|3|R

Multiplication of two values with subsequent right shift and result limitation

/>|*|*|*|*

div_r_%t1%%t2%_%tr%(%i1%, %i2%, %i3%)

O|1|2|3|R

Division of two values with subsequent right shift

/>l|*|*|*|*

div_rl_%t1%%t2%_%tr%(%i1%, %i2%, %i3%)

O|1|2|3|R

Division of two values with subsequent right shift and result limitation

*/|*|*|*|*

muldiv_%t1%%t2%%t3%_%tr%(%i1%, %i2%, %i3%)

O|1|2|3|R

Multiplication of two values with subsequent division

*/l|*|*|*|*

muldivl_%t1%%t2%%t3%_%tr%(%i1%, %i2%, %i3%)

O|1|2|3|R

Multiplication of two values with subsequent division and saturationb

getHighPart

_(%i1%)

O

Returns the highest bit of a value

a: See Tab. 3 in Function Declaration for definitions of the formal arguments

b: Saturation refers to the act of limiting results to within maximum possible range of values for the relevant type of result.

Tab. 1: Arithmetic services understood by ASCET

See also

Arithmetic Services File

Managing Entries