1. A bitwise and expression will return a 1 if both bits, have a value of 1 (i.e., if both bits are true). Otherwise, it will return a value of 0.
2. A bitwise exclusive or expression will return a 1 if one of the bits has a value of 1 (i.e., if one bit is true, the other is false). Otherwise, it will return a value of 0.
3. A bitwise or expression will return a 1 if one or more bits, have a value of 1 (i.e., if one or both bits are true). Otherwise, it will return a value of 0.
The results are summarized in the following table.
b1 | b2 | b1&b2 | b1^b2 | b1|b2 |
1 | 1 | 1 | 0 | 1 |
1 | 0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 | 1 |
0 | 0 | 0 | 0 | 0 |
No comments:
Post a Comment