Bit manipulation Flashcards
1
Q
What does a»_space; 2 mean?
A
Shifting a to the right 2 places
2
Q
What does a «_space;1 mean?
A
Shifting to the left 1 place
3
Q
When a = 10100000 what does a | (1 «2) look like?
A
1 «_space;2 = 00000100
10100000 | 00000100 = 10100100
4
Q
When a = 10100000 what does a &= ~(1 «_space;7) look like?
A
1 «_space;7 = 10000000
~(1 «_space;7) = 011111111
01111111 & 10100000 = 00100000
5
Q
What is bitwise AND?
A
&
6
Q
What is bitwise OR?
A
|
7
Q
What is bitwise XOR?
A
8
Q
What is bitwise NOT?
A
~