Shift Operations
Learn what shift operations are, and what they're used for.
We'll cover the following...
Shift operations
Shift operations involve shifting the bits in a binary number to the left or right. Thus they are appropriately named right shift and left shift.
Left shift
Left shifting a binary number is equivalent to multiplying it with . A left shift is represented with <<.
To perform a left shift by we:
- Remove the most significant bit
- Append a as the least significant bit
For example:
<< ...