Jump to content

Functions Palette/Programming/Boolean

From LabVIEW Wiki
Revision as of 16:40, 2 September 2019 by Logmanoriginal (talk | contribs) (Make palette image controllable and add object information)
AndOrExclusive OrNotCompound ArithmeticNot AndNot OrNot Exclusive OrImpliesAnd Array ElementsOr Array ElementsNum to ArrayArray to NumBool to (0,1)True ConstantFalse Constant
Boolean palette (Click on a function to navigate, or on the arrow to go to parent palette)
Object information
Owning palette(s) Programming palette
Type Palette
Requires Basic Development Environment

The Boolean palette provides constants and functions that can be performed on Boolean, Numeric and Fixed-point values.

Logical And Logical And

Accepts two Boolean or numeric inputs.

Boolean: If provided Boolean values, returns True if both inputs are True, otherwise returns False.

x y output
False False False
False True False
True False False
True True True

Numeric: If provided numeric values, performs a bit-wise AND operation.

Binary Decimal
x 10101010 170
y 11110000 240
output 10100000 160

Logical Or Logical Or

Accepts two Boolean or numeric inputs.

Boolean: If provided Boolean values, returns True if any input is True, otherwise returns False.

x y output
False False False
False True True
True False True
True True True

Numeric: If provided numeric values, performs a bit-wise OR operation.

Binary Decimal
x 10101010 170
y 11110000 240
output 11111010 250

Exclusive Or Exclusive Or

Accepts two Boolean or numeric inputs.

Boolean: If provided Boolean values, returns True if any input is True exclusively, otherwise returns False.

x y output
False False False
False True True
True False True
True True False

Numeric: If provided numeric values, performs a bit-wise XOR operation.

Binary Decimal
x 10101010 170
y 11110000 240
output 01011010 90

Not Not

Returns the inverted value of an Boolean or numeric input.

Boolean:

x output
False True
True False

Numeric:

Binary Decimal
x 10101010 170
output 01010101 -171

Compound Arithmetic Compound Arithmetic

Change mode on the Compound Arithmetic function

Performs various logical and arithmetic operations on Boolean and numeric values for a dynamic amount of inputs.

Available operations:

This function is especially useful when doing logical and arithmetic operations on more than two input values.

Invert input and output:

The Compound Arithmetic function allows to invert any of the inputs as well as the output selectively.

Invert input on the Compound Arithmetic function


Not And Not And

This is the same as Logical And but the output is inverted.

Boolean:

x y output
False False True
False True True
True False True
True True False

Numeric

Binary Decimal
x 10101010 170
y 11110000 240
output 01011111 95

Not Or Not Or

This is the same as Logical Or but the output is inverted.

Boolean:

x y output
False False True
False True False
True False False
True True False

Numeric:

Binary Decimal
x 10101010 170
y 11110000 240
output 00000101 5

Not Exclusive Or Not Exclusive Or

This is the same as Exclusive Or but with inverted output.

Boolean:

x y output
False False True
False True False
True False False
True True True

Numeric:

Binary Decimal
x 10101010 170
y 11110000 240
output 10100101 165

Implies Implies

Accepts two Boolean or numeric inputs.

Boolean: If provided Boolean values, returns False if the first input is True and the second input is False. Otherwise returns True.

x y output
False False True
False True True
True False False
True True True

Numeric: If provided numeric values performs a bit-wise implies operation.

Binary Decimal
x 10101010 170
y 11110000 240
output 11110101 -11

And Array Elements And Array Elements

Performs the Logical And on an n-dimensional array of Boolean values. This means, the output is True if all elements of the array are True. Note that this function works an multi-dimensional arrays, not just one-dimensional.

Or Array Elements Or Array Elements

Performs the Logical Or on an n-dimensional array of Boolean values. This means, the output is True if any element of the array is True. Note that this function works an multi-dimensional arrays, not just one-dimensional.

Num to Array Num to Array

Converts an integer or fixed-point number to a Boolean array. The size of the output array depends on the size of the provided number. Note that the least significant bit is at index zero.

Array to Num Array to Num

Converts a Boolean array to an integer or fixed-point number with the least significant bit at index zero.

Bool to (0,1) Bool to (0,1)

Returns a Boolean into a 16-bit integer.

x output
False 0
True 1

True Constant True Constant

This is the Boolean True constant True

False Constant False Constant

This is the Boolean False constant False

See also