User`s manual
8-16
The operations are performed in bitwise fashion; this means that each bit of
the result is obtained by examining the bit in the same position for each
argument.
The following truth tables show the logical relationship between bits:
OPERATOR ARGUMENT I ARGUMENT 2 RESULT
AND 1
0
1
0
1
1
0
0
1
0
0
0
OPERATOR ARGUMENT I ARGUMENT 2 RESULT
OR 1
1
0
0
1
0
1
0
1
1
1
0
OPERATOR ARGUMENT RESULT
NOT 1
0
0
1
EXAMPLES:
(In all of the examples below, leading zeroes on binary numbers are not
shown.)
63 AND 16 = 16 Since 63 equals binary 111111 and 16 equals binary
10000, the result of the AND is binary 10000 or 16.
15 AND 14 = 14 15 equals binary 1111 and 14 equals binary 1110, so 15
and 14 equals binary 1110 or 14.
-1 AND 8 = 8 -1 equals binary 1111111111111111 and 8 equals binary
1000, so the result is binary 1000 or 8 decimal.
4 AND 2 = 0 4 equals binary 100 and 2 equals binary 10, so the result
is binary 0 because none of the bits in either argument
match to give a 1 bit in the result.
4 OR 2 = 6 Binary 100 OR'd with binary 10 equals binary 110, or 6
decimal.
10 OR 10 = 10 Binary 1010 OR'd with binary 1010 equals binary 1010,
or 10 decimal.
-1 OR -2 = -1 Binary 1111111111111111 (-1) OR'd with binary
1111111111111110 (-2) equals binary
1111111111111111, or-1.










