Bitwise Concatenate Compare to Error navigation bar

Table of Contents

Compare

Compares two signals.

Library

QUARC Targets/Logic Operations

Description

Compare

The Compare block compares its two input signals and outputs the result of the comparison. It is a simplified version of the Relational Operator block that is used internally by some QUARC blocks for compatibility across disparate MATLAB versions.

The block compares the first input to the second input. For example, if the operator selected is "<" then it will output the result of the comparison:

(first input < second input)

If the input signals are vectors then the output will be a vector of the same dimensions, with each element representing the comparison applied to the corresponding input elements. One of the inputs may be a scalar when the other input is a vector. The Compare block supports multidimensional signals as well.

Input Ports

u

The first operand in the comparison.

v

The second operand in the comparison.

Output Ports

y

The result of the comparison. The data type of the output is determined by the Output data type parameter.

Data Type Support

The Compare block supports any of the standard Simulink data types at its input. It does not currently support fixed-point signals. The output may be a boolean or uint8.

Parameters and Dialog Box

Compare

Operator

The comparison operator to apply. The block compares the first input to the second input using the given operator.

Output data type

The data type to use for the output. Only two data types are currently supported: boolean and uint8.

Warning Use the uint8 data type if arithmetic operations are going to be performed on the output. For example, if a Gain block is applied to a boolean signal it produces a boolean 0 or 1 result rather than multiplying the output by the gain. However, if the Gain block is applied to a uint8 data type then it produces the expected multiplied output.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

Yes

Yes

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

* Compatible means that the block can be compiled for the target.

See Also

 

navigation bar