To control hardware
One example:
Microchips have pins that send signals to hardware (e.g. LED lights, USB cables)
What is the one's complement operator?:
~
1
s to 0
s0
s to 1
sWhy one's complement operator important?:
Toggling pins on and off is fundamental to controlling hardware
How to use one's complement operator?:
What are the logical bitwise operators?:
&
1
, then the result is 1
0
|
1
, then the result is 1
0
^
1
, then the result is 1
0
bit1 | bit2 | bit1 & bit2 | bit1 | bit2 | bit1 ^ bit2 |
---|---|---|---|---|
1 | 1 | 1 | 1 | 0 |
1 | 0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 | 1 |
0 | 0 | 0 | 0 | 0 |
Why are logical bitwise operators important?:
they are the building blocks of comparisons
How to use logical bitwise operators?:
How to mask with logical bitwise operators?
What are the shift operators?:
<<
>>
Why are shift operators important?:
you can read the article at http://stackoverflow.com/questions/520625/have-you-ever-had-to-use-bit-shifting-in-real-projects
How to use shift operators?: