Professional Documents
Culture Documents
P15 Bitwise Operation
P15 Bitwise Operation
P15 Bitwise Operation
2/15/2012
Bitwise Operators
Smallest memory element which we have used so far is byte. When you want to interact with the hardware, you need to handle bits. Programming languages-byte oriented Hardware-bit oriented This operators plays a vital role in the case of embedded systems.
2/15/2012 2
Bitwise Operators
Operates only on integer and character. Bitwise operators available in c.
2/15/2012
Bitwise operators
Bit numbering scheme for characters
2/15/2012
Bitwise operators
Finding the binary equivalent of integer and character.
Construct a mask of width 16-bit. and the mask with integer value which has to be converted to binary. If the anded value is 1,then 1 is placed in the position, else 0 is placed in the position.
2/15/2012
.. 0000 0000 0000 0111 & 0000 0000 0000 0100 0000 0000 0000 0111 & 0000 0000 0000 0010 0000 0000 0000 0111 & 0000 0000 0000 0001 0000 0000 0000 0111
6
2/15/2012
2/15/2012
2/15/2012
10
Importance of AND operator: Used to check whether a particular bit is on or off It is used to turn off a particular bit in a number
2/15/2012
11
Bitwise OR operator
Represented by | operator Similar to AND operator, operates on two operands. Used to put on a particular bit in a number.
2/15/2012
12
2/15/2012
13
I request Electronics and communication ENGINEERING students to visit my blog for more abhishek1ek.blogspot.com awhengineering.blogspot.com
2/15/2012
14
2/15/2012
15