# Logic and Bit Operations

## Introduction

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 |

T | 1 |

F | 0 |

The table for the bit operators is shown below:

## Practice Exercise and Solution

Exercise 1:

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.

Solution:

The bitwise AND, bitwise OR, and bitwise XOR of these strings are obtained by taking the AND, OR, and XOR of the corresponding bits:

- Bitwise AND: 01 0001 0100
- Bitwise OR: 11 1011 1111
- Bitwise XOR: 10 1010 1011

For more details, please contact me here.

Date of last modification: February 27, 2019