Logic and Bit Operations
Computer bit operations correspond to the logical connectives.
By replacing true by a one and false by a zero in the truth tables for the operators ∧, ∨, and ⊕,
the tables shown for the corresponding bit operations are obtained.
Throughout this lesson and in various programming languages, the following notations will be used: AND, OR, and XOR for the operators ∧, ∨, and ⊕.
Truth Value of Bit
|Truth Value ||Bit
The table for the bit operators is shown below:
Practice Exercise and Solution
Find the bitwise AND, bitwise OR, and bitwise XOR of the bit strings 01 1011 0110 and 11 0001 1101.
Please note that in this lesson, bit strings will be split into blocks of four bits to make them easier to read.
The bitwise AND, bitwise OR, and bitwise XOR of these strings are obtained by taking the AND, OR, and XOR of the corresponding bits:
For more details, please contact me here.
- Bitwise AND: 01 0001 0100
- Bitwise OR: 11 1011 1111
- Bitwise XOR: 10 1010 1011
Date of last modification: February 27, 2019