What is "bitwise"
Binary logic, or bitwise Operation, is the basis of all computational calculus. In fact, it is these most basic operations that constitute all the power of computers. Any operation, however complex it may seem, is translated internally by the processor for these operations.
Has 5 Operations
AND: The binary operator AND, or binary conjunction returns a bit 1 whenever both operands are '1', as we can confirm by the truth table, where A and B are bits input and S is bit-response, or output bit.
OR: The binary operator OR, or binary disjunction returns a bit 1 whenever at least one of the operands is '1', as confirmed by the truth table, where A and B are the input bits and S is the response bit, or output bit.
XOR: The binary operator XOR, or unique binary disjunction returns a bit 1 whenever the number of operands equal to 1 is odd, as confirmed by the truth table.
Shift: Bit displacement is an elementary binary logic operation consisting of rotating a set of bits (such as a byte or word, for example). Due to the characteristics of the binary system, there is direct correspondence with the following mathematical operations.
- multiplication (by 2) of the operand - if the shift is to the left.
- whole division (by 2) of the operand - if the displacement is done to the right.