Bit Manipulation: Left Shift And Right Shift Operators.

Left Shift:

The '<<' operator is used to perform Left Shift Operations.
'x<<y' means x shifted by y bits to the left. Like $00101<<2=10100$.
If you start shifting and you run out of space, the bits just drop off. Here are some more examples:

\[00011001<<2=01100100\]
\[00011001<<4=10010000\]

Right Shift:

The '>>' operator is used to perform the Right Shift Operations.
'x>>y' means x is shifted by y bits to the left. Like $00101>>2 = 00001$. If you start shifting and you run out of space, the bits just drop off the end. Here are some more examples:
\[00011001>>2=00000110\]
\[00011001>>4=00000001\]

No comments:

Post a Comment

Installing albert on ubuntu 19.04

Installing Albert on Ubuntu 19.04... Albert is not still released for ubuntu 19.04. But still, you can install it using the following ...