Arithmetic Block Models

General_Expression




Description
General_Expression provides a capability to generate an output
which is a function of the data received at the input ports
and specified constants, Variables or Macros. The number of
input ports and the naming of the input ports is arbitrary
(in1 is provided as a default). A variety of operators may
be used, including:        +, -, *, /, %,
         RANDOM, SQRT(x), LOG(x), EXP(x), ABS(x), TRUNC(x),
         ROUND(x), FLOAT(x), SQR(x), MIN(x,y), MAX(x,y)
 (see:
   SCHEDULER functions)
                                                                                           
The user specifies the output function as an attribute string
for an attribute "out", for example, expressions could be:
    out = in1 * in2 * 1.0e-7
    out = in1 * in2 * in3
    out = bozo * data_rate + gandalf (assuming that bozo and
               gandalf are either inputs, variables or macros)

Because General_Expression is an interpreted rather than compiled
block, its execution time is relatively long.

Ports

Input Ports
Output Ports
Parameters

Reciprocal



File: general_blocks/Arithmetic/reciprocal.sim
Description
The model inverts real input. If the input is zero, a value representing floating point infinity is placed on the output.

Ports

Input Ports
Output Ports
Parameters

tan_X

File: general_blocks/Arithmetic/real_tan.sim
Description
The model calculates the tangent of the radian argument on the port in and places the result the port out.

Ports

Input Ports
Output Ports
Parameters

R_subtract

File: general_blocks/Arithmetic/real_subtract.sim
Description
The model subtracts in2 from in1 and places the result on the port out.

Ports

Input Ports
Output Ports
Parameters

Rsqrt

File: general_blocks/Arithmetic/real_sqrt.sim
Description
The model returns the Square Root of the value of in. If the value is negative then an error message will be printed in the simulation Error file and the port out will not be enabled.

Ports

Input Ports
Output Ports
Parameters

sin_X

File: general_blocks/Arithmetic/real_sin.sim
Description
The model calculates the sine of the radian argument on the port in and places the result on the port out.

Ports

Input Ports
Output Ports
Parameters

X_powr_Iconst

File: general_blocks/Arithmetic/real_raise_by_constant.sim
Description
The model is used to raise a real input by an integer power.

Ports

Input Ports
Output Ports
Parameters

Ilimiter

File: general_blocks/Arithmetic/Ilimiter.sim
Description
Limiter for integer inputs.

Ports

Input Ports
Output Ports
Parameters

Rlimiter

File: general_blocks/Arithmetic/Rlimiter.sim
Description
Limiter for real inputs.

Ports

Input Ports
Output Ports
Parameters

X_powr_Y

File: general_blocks/Arithmetic/real_raise.sim
Description
The model is used to raise a real number (in1) to a power specified by another number (in2).

Ports

Input Ports
Output Ports
Parameters

R_divprotect

File: general_blocks/Arithmetic/real_protect.sim
Description
The model divides one real number by another. If the in2 value is equal to 0.0 then the FLT_MAX is put on out.

Ports

Input Ports
Output Ports
Parameters

Rchs

File: general_blocks/Arithmetic/real_negate.sim
Description
The model is used to change a sign of a REAL number. The port in is multiplied by -1.

Ports

Input Ports
Output Ports
Parameters

R_mult

File: general_blocks/Arithmetic/real_multiply.sim
Description
The model multiplies the value of in1 by int2.

Ports

Input Ports
Output Ports
Parameters

Rmin

File: general_blocks/Arithmetic/real_min.sim
Description
The model selects the smallest of the two real input values and places it on out.

Ports

Input Ports
Output Ports
Parameters

Rmax

File: general_blocks/Arithmetic/real_max.sim
Description
The model selectes the largest of the two real inputs values and places it on out.

Ports

Input Ports
Output Ports
Parameters

ln_X

File: general_blocks/Arithmetic/real_ln.sim
Description
The model computes the natural logarithm of in and places the value of the natural log on out.

Ports

Input Ports
Output Ports
Parameters

Rgain

File: general_blocks/Arithmetic/real_gain.sim
Description
The model multplies the real input by the Gain parameter.

Ports

InputPorts
Output Ports
Parameters

exp_X

File: general_blocks/Arithmetic/real_exp.sim
Description
The model the function exp(x). The constant e (2.7182818..) is raised to the power specified by the input value on in. The result is placed on out.

Ports

Input Ports
Output Ports
Parameters

R_div

File: general_blocks/Arithmetic/real_divide.sim
Description
The model divides the value of in1 by the value of in2 and places the result on out. If in2 is zero then a message will be written to the simulation Error file (divide by zero error).

Ports

Input Ports
Output Ports
Parameters

cos_X

File: general_blocks/Arithmetic/real_cos.sim
Description
The model calculates the cosine of the radian argument on in.

Ports

Input Ports
Output Ports
Parameters

R_add

File: general_blocks/Arithmetic/real_add.sim
Description
The model adds the value of in1 and in2.

Ports

Input Ports
Output Ports
Parameters

Rabs

File: general_blocks/Arithmetic/real_abs.sim
Description
The model places the absolute value of in on the port out.

Ports

Input Ports
Output Ports
Parameters

I_subtract

File: general_blocks/Arithmetic/int_subtract.sim
Description
The model subtracts in2 from in1 and places the result on the port out.

Ports

Input Ports
Output Ports
Parameters

I_divprotect

File: general_blocks/Arithmetic/int_protect.sim
Description
The model divides on integer number by another. If the in2 value is equal to 0, then INT_MAX is put on out.

Ports

Input Ports
Output Ports
Parameters

Ichs

File: general_blocks/Arithmetic/int_negate.sim
Description
The model changes the sign of an INTEGER value. The sign is changed by multiplying in value by -1.

Ports

Input Ports
Output Ports
Parameters

Imult

File: general_blocks/Arithmetic/int_multiply.sim
Description
The model multiplies the integer values placed on in1 and in2, and places the product on out.

Ports

Input Ports
Output Ports
Parameters

Imod

File: general_blocks/Arithmetic/int_modulus.sim
Description
The model divides the value of in1 by the value of in2 and places the quotient on the quo port and the remainder on the rem port. If the value of in2 is equal to zero, then a message will be written to the simulation error file (divide by zero error).

Ports

Input Ports
Output Ports
Parameters

I_mod

File: general_blocks/Arithmetic/int_mod.sim
Description
The model divides the value of in1 by the value of in2 and places the remainder on the out port. If the value of in2 is equal to zero, the a message will be written to the simulation error file (divide by zero error).

Ports

Input Ports
Output Ports
Parameters

Imin

File: general_blocks/Arithmetic/int_min.sim
Description
The model selects the smallest of the two integer input values and places it on out.

Ports

Input Ports
Output Ports
Parameters

Imax

File: general_blocks/Arithmetic/int_max.sim
Description
The model selects the largest of the two integer input values and places it on out.

Ports

Input Ports
Output Ports
Parameters

Igain

File: general_blocks/Arithmetic/int_gain.sim
Description
The model multiplies the integer input value by the gain parameter.

Ports

Input Ports
Output Ports
Parameters

I_div

File: general_blocks/Arithmetic/int_divide.sim
Description
The model divides the value of in1 by the value of in2 and places the result on out. If in2 is equal to 0 then a message will be written to the simulation Error file (divide by zero error).

Ports

Input Ports
Output Ports
Parameters

I_add

File: general_blocks/Arithmetic/int_add.sim
Description
The model adds the value of in1 and in2.

Ports

Input Ports
Output Ports
Parameters

Iabs

File: general_blocks/Arithmetic/int_abs.sim
Description
The model places the absolute value of in on the port out.

Ports

Input Ports
Output Ports
Parameters

Increment

File: general_blocks/Arithmetic/increment.sim
Description
The model increments the in value by one.

Ports

Input Ports
Output Ports
Parameters

Decrement

File: general_blocks/Arithmetic/decrement.sim
Description
The model decrements the in value by one.

Ports

Input Ports
Output Ports
Parameters

five_input_expression

File: general_blocks/Arithmetic/5_input_expression.sim
Description
The user can specify a function of the inputs which will be evaluated when all the inputs used in the expression are enabled.

Ports

Input Ports
Output Ports
Parameters

one_input_expression_I



File: general_blocks/Arithmetic/one_input_expression_I.sim
Description
This box calculates a function of the input of the form
output = m * input + b

Ports

Input Ports
Output Ports
Parameters

one_input_expression_R



File: general_blocks/Arithmetic/one_input_expression_R.sim
Description
This box calculates a function of the input of the form
output = m * input + b

Ports

Input Ports
Output Ports
Parameters