Relational Operator

Description of the Relational Operator components in Schematic Editor, which performs comparisons between two input signals.

Component Icon

Figure 1. Relational operator icons

Description

The Relational Operator component performs the comparison defined in relational operation property between two input signals.

If the comparison is true, output is 1, if the comparison is false, the output is 0.

Terminal labeled with ‘ is a primary input and the comparison is performed on that signal.

out = in’ ≥ in

Available operations of the relational operator component are:

Table 1. Truth table of available relational operations
== True if inputs are equal.
!= True if inputs are not equal.
<= True if primary input is lower or equal to the secondary input.
>= True if primary input is greater or equal to the secondary input.
< True if primary input is lower than the secondary input
> True if primary input is greater than the secondary input.
Both inputs can be scalar or vector. The operation is performed following the rules:
  • If both signals are scalars, the output is also scalar.
  • If both inputs are vectors, they must be the same size and operation is performed element-wise.
  • If one input is scalar and one is vector, the output will be vector. The operation is performed by comparing each element of the vector input to the value of the scalar input.

Ports

  • Primary input - marked with (') (in)
    • The primary input that is going to be used in the relational operator comparison.
      • Supported types: uint, int and real.
      • Vector support: yes.
  • Secondary input (in)
    • The secondary input that is going to be used in the relational operator comparison.
      • Supported types: uint, int and real.
      • Vector support: yes.
  • Output (out)
    • Result of the operation performed by the comparison. The result is 1 for True and 0 for False.
      • Supported types: uint, int and real.
        • The output type is inherited from the input signal.
      • Vector support: yes.
        • The vector length is inherited from input signals.

Properties

  • Relational operation
    • Select the Comparison operation that will be performed by the relational operator. Six operations are available: equal to (==); different than (!=); less than or equal to (<=); greater than or equal to (>=); less than (<); and greater than (>).
  • Execution rate
    • Type in the desired signal processing execution rate. This value must be compatible with other signal processing components of the same circuit: the value must be a multiple of the fastest execution rate in the circuit. There can be up to four different execution rates, but they must all be multiple of the basic simulation timestep. To specify the execution rate, you can use either decimal (e.g. 0.001) or exponential values (e.g. 1e-3) in seconds. Alternatively, you can type in ‘inherit’ in which case the component will be assigned execution rate based on the execution rate of the components it is receiving input from.