Section 6.8
Review Questions
Bitwise Logical Operations
-
In the blank to the left of each C logical operator below, write
the logical operation's name:
________________ &
________________ |
________________ ^
answer...
AND &
OR |
NOT ^
-
The logical operations also have other names or functions. Match them up:
AND complement
OR filter
NOT collector
answer...
AND ----> filter
OR ----> collector
NOT ----> complement
-
Perform the indicated operations below:
10011100 1011100 1011100
& 01101010 | 0110101 ^
----------- --------- --------
answer...
10011100 1011100 1011100
& 01101010 | 0110101 ^
----------- --------- --------
00001000 1111101 0100011
-
What is the difference between performing bitwise AND between two bit
strings and performing AND on a single string of bits?
answer...
A bit-wise AND or OR is just a bunch of 2-input operations, whereas
a string-wise AND or OR is a multi-input operation.