Using Simulink    
Logical Operator

Perform the specified logical operation on the input.

Library

Math

Description

The Logical Operator block performs any of these logical operations on its inputs: AND, OR, NAND, NOR, XOR, and NOT. The output depends on the number of inputs, their dimensionality, and the selected operator. The output is 1 if TRUE and 0 if FALSE. The block icon shows the selected operator. The following rules apply to the inputs and outputs of the block:

When configured as a multi-input XOR gate, this block performs an addition modulo two operation as mandated by the IEEE standard for logic elements.

Data Type Support

A Logical Operator block accepts only signals of type boolean on its input ports, if Boolean logic signals are enabled (see Enabling Strict Boolean Type Checking). Otherwise, the block also accepts inputs of type double. A nonzero input of type double is treated as TRUE (1), a zero input as FALSE (0). All inputs must be of the same type. The output of the block is of the same type as the input.

Parameters and Dialog Box

Operator
The logical operator to be applied to the block inputs. Valid choices are the operators listed above.
Number of input ports
The number of block inputs. The value must be appropriate for the selected operator.

Characteristics

Direct Feedthrough
Yes
Sample Time
Inherited from driving block
Scalar Expansion
Of inputs
Dimensionalized
Yes
Zero Crossing
No


 Interpolation (n-D) Using PreLook-Up Look-Up Table