Logical Left Shift (<<)
In a logical left shift, the bits are shifted to the left by a specified number of positions.
The leftmost bit (sign bit) is shifted out/discarded, and the vacant position on the right is filled with a zero.
Logical left shifts are primarily used for unsigned integer manipulation and simple bit operations.
Example shift of left shift of 1 for 10110101

10110101 becomes 01101010
Logical Right Shift (>>)
In a right shift operation, the bits of a binary number are shifted to the right by a specified number of positions.
Similar to left shifts, new bits are introduced on the left side, and the rightmost bits are discarded. Each right shift effectively divides the number by 2 for each position shifted.

Right Logical Shift Example
For example, if you right-shift the binary number "1010" by one position, you get "0101," which is equivalent to dividing 1010 by 2^1 (2).
Here you can see a key advantage of storing numbers in binary - division is a simple process.
Uses of Logical Bit Shifts
A logical shift is used in computing and digital systems for several purposes, primarily in bitwise operations. Here’s when you would use it:
Bit Manipulation
Logical shifts are used to manipulate individual bits in a binary number, such as clearing or setting specific bits.
Multiplication & Division of unsigned integers
A logical left shift (<<) effectively multiplies a number by 2 for each shift position.
A logical right shift (>>) divides a number by 2 for each shift position (but without sign extension).
Logical Arithmetic Shifts Demo
Review: Fill in the Blanks
In a right shift operation, the bits of a binary number are shifted to the by a specified number of positions. New bits are introduced on the side, and the rightmost bits are discarded. Each right shift effectively divides the number by 2 for each position shifted. For instance, if you right-shift the binary number "1010" by one position, you get "0101," which is equivalent to dividing 1010 by 2^1 (2).
Logical shifts are used in computing and digital systems for several purposes, primarily in operations. A logical left shift effectively multiplies a number by 2 for each shift position, while a logical right shift divides a number by 2 for each shift position (but without sign extension). Logical shifts enable the manipulation of individual bits in a binary number, such as clearing or setting specific bits.
Complete! Ready to test your knowledge?
Logical Binary Shifts
- Logical Left Shift (<<)
- Logical Right Shift (>>)
- Right Logical Shift Example
- Uses of Logical Bit Shifts
- Logical Arithmetic Shifts Demo