0% found this document useful (0 votes)
55 views

Bitwise Operations: Bitwise AND: Truth Table

The document describes different bitwise operations including bitwise AND, OR, XOR, and bit shifts. It provides truth tables and examples to illustrate each operation. Bitwise AND compares each bit of two binary numbers and returns a 1 only if both bits are 1. Bitwise OR returns a 1 if either or both bits are 1. Bitwise XOR returns 1 only if the bits are different. Bit shifts move all bits of a binary number left or right by a specified number of positions, filling empty bits with 0.

Uploaded by

leidinar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Bitwise Operations: Bitwise AND: Truth Table

The document describes different bitwise operations including bitwise AND, OR, XOR, and bit shifts. It provides truth tables and examples to illustrate each operation. Bitwise AND compares each bit of two binary numbers and returns a 1 only if both bits are 1. Bitwise OR returns a 1 if either or both bits are 1. Bitwise XOR returns 1 only if the bits are different. Bit shifts move all bits of a binary number left or right by a specified number of positions, filling empty bits with 0.

Uploaded by

leidinar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Bitwise Operations

Bitwise AND:
Truth Table
0
0
1
1

0
1
0
1

0
0
0
1

Example:

Bitwise OR:
Truth Table
0
0
1
1
Example:

0
1
0
1

0
1
1
1

Bitwise XAND:
Truth Table
0
0
1
1

0
1
0
1

1
0
0
1

Example:

Bitwise XOR:
Truth Table
0
0
1
1
Example:

0
1
0
1

0
1
1
0

Bit Shift Left:

is equivalent to
Sample
0001
0001
0001
0001

0
1
2
3

0001
0010
0100
1000

Example:

Bit Shift Right:

is equivalent to
Sample
0100
0100
0100
0100
1000
1000
1000
1000
Example 1:

Example 2:

0
1
2
3
0
1
2
3

0100
0010
0001
0000
1000
1100
1110
1111

You might also like