Teledyne LeCroy Protocol Analyzers File-Based Decoding User Manual User Manual
Page 19

File-based Decoding User Manual
Chapter 4: Operators
LeCroy Corporation
13
Logical Operators
!
Negation
All combinations of types
Integer
!0 = 1 !"cat" = 0
!9 = 0 !"" = 1
&&
Logical AND
All combinations of types
Integer
1 && 1 = 1 1 && !"" = 1
1 && 0 = 0 1 && "cat" = 1
||
Logical OR
All combinations of types
Integer
1 || 1 = 1 0 || 0 = 0
1 || 0 = 1 "" || !"cat" = 0
Bitwise Logical Operators
~
Bitwise
complement
Integer-integer
Integer
~0b11111110 = 0b00000001
&
Bitwise AND
Integer-integer
Integer
0b11111110 & 0b01010101 = 0b01010100
^
Bitwise exclusive
OR
Integer-integer
Integer
0b11111110 ^ 0b01010101 = 0b10101011
|
Bitwise inclusive
OR
Integer-integer
Integer
0b11111110 | 0b01010101 = 0b11111111
Shift Operators
<<
Left shift
Integer-integer
Integer
0b11111110 << 3 = 0b11110000
>>
Right shift
Integer-integer
Integer
0b11111110 >> 1 = 0b01111111
Operator
Symbol
Description
Operand Types
Result
Types Examples
Table 4.2 Operators (Continued)