Object Oriented Programming
Lab Report
Bit
Wise Functions:
Left
Shift
Left Shift makes the number to shift
towards left. This sequence is used in Binary Number system and conversion is
done in binary number system. Considering an example will help to understand it
properly.
e.g.
·
An 8
bit number (10010101) in Base 2.
·
Make
3 left shift of the red number 1
Solution:
Hence by left shifting it we will
get a number
(10101000) in Base 2
Right Shift
Right Shift makes the number to
shift towards right. This sequence is used in Binary Number system and
conversion is done in binary number system. Considering an example will help to
understand it properly.
e.g.
·
An 8
bit number (10010101) in Base 2.
·
Make
3 right shift of the red number 1
Solution:
Hence by right shifting it we will
get a number
(00010010) in Base 2
Logical Operators
I.
AND
II.
OR
III.
NOT
IV.
XOR
Symbols Notation and Operations for Logical Operators:
I.
AND & Multiplication (A&B)
II.
OR | Addition (A|B)
III.
NOT ~ Inverter (A~)
IV.
XOR ^ A`B +AB` (A^B)
0 comments:
Post a Comment