LogicalOp

Performs a logical operation on the block inputs.

    LogicalOp

Library

LogicalOperations

Description

Performs a logical operation on the block inputs.

Supported operations are : AND, OR, NAND, NOR, XOR and NOT.

if the operator is "AND", the result is TRUE if all inputs are TRUE.

if the operator is "OR", the result is TRUE if at least one input is TRUE.

if the operator is "NAND", the result is TRUE if at least one input is FALSE.

if the operator is "NOR", the result is TRUE when no inputs are TRUE.

if the operator is "XOR", the result is TRUE if an odd number of inputs are TRUE.

if the operator is "NOT", the result is TRUE if the input is FALSE.

The convention is that a value is FALSE if it is zero and is TRUE (or 1) otherwise.

Parameters

LogicalOp_0

NameLabelDescriptionData TypeValid Values

nin

Number of inputs

Number of inputs of the block. Integer value.
The operator NOT only supports one input.

Number

rule

Operator

Logical operators supported by the LogicalOp block are : AND, OR, NAND, NOR, XOR, NOT.

String

'AND'
'OR'
'NAND'
'NOR'
'XOR'
'XNOR'
'NOT'

Datatype

Datatype

Defines the datatype of the input and output.
Supported types are : double, int32, int16, int8, uint32, uint16, uint8, inherit.

String

'double'
'int32'
'int16'
'int8'
'uint32'
'uint16'
'uint8'
'boolean'
'inherit'

tp

Bitwise rule

If this parameter is set, operators are applied bitwise. It is only applicable to integer inputs.

Scalar

0
1

externalActivation

External activation

Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected.

Number

0
1

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

output

1

Port 2

explicit

input

nin

Port 3

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no