Results of Bitwise operation
In digital computer programming, a bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits. It is a fast and simple action, directly supported by the processor, and is used to manipulate values for comparisons and calculations. On simple low-cost processors, typically, bitwise operations are substantially faster than division, several times faster than multiplication, and sometimes significantly faster than addition.
Here you can use following bitwise operations:
Check this truth table for your reference.
A | B | A OR B | A AND B | A XOR B |
---|---|---|---|---|
1 | 1 | 1 | 1 | 0 |
0 | 1 | 1 | 0 | 1 |
1 | 0 | 1 | 0 | 1 |
0 | 0 | 0 | 0 | 0 |