Bit Shift Calculator
Bit Shift Calculator
To perform Bit Shift Operations, input Binary or Decimal Number, select Shift Direction (Left / Right) and specify number of Positions to shift. Our calculator supports both Logical and Arithmetic shifts for positive and negative numbers.
The calculator will perform bit shift operation and display the result in both decimal and binary formats.
How to Calculate Bit Shift?
To calculate a Bit Shift, first convert your Decimal Number to Binary Format if needed. For Left Shifts, move all bits to left by specified positions, filling vacated positions with 0s.
Each Left Shift multiplies number by 2. For Right Shifts, move bits to right, with Logical Shifts filling with 0s and Arithmetic Shifts preserving the Sign Bit.
Each Right Shift divides number by 2. Keep track of any bits that shift beyond number’s boundaries as they are lost.
Formula for Bit Shift
Left Shift Operation:
Result = Number × 2^n
where:
Number = Original decimal number
n = Number of positions to shift left
Binary Process = Append n zeros to right
Logical Right Shift:
Result = Number ÷ 2^n
where:
Number = Original decimal number
n = Number of positions to shift right
Binary Process = Prepend n zeros to left
Arithmetic Right Shift:
Result = Number ÷ 2^n (with sign preservation)
where:
Number = Original decimal number
n = Number of positions to shift right
Binary Process = Prepend n copies of sign bit
Decimal to Binary Conversion:
Binary = Base-2 representation
where:
Positive Numbers = Standard binary conversion
Negative Numbers = Two's complement representation
Example 1: Left Shift
- Original Number = 5 (Binary: 0101)
- Shift Direction = Left
- Shift Amount = 2 positions
- Result = 20 (Binary: 10100)
- Calculation Type: Multiplication by 4
Example 2: Logical Right Shift
- Original Number = 12 (Binary: 1100)
- Shift Direction = Right
- Shift Amount = 1 position
- Result = 6 (Binary: 0110)
- Calculation Type: Division by 2
Example 3: Arithmetic Right Shift
- Original Number = -8 (Binary: 11111000)
- Shift Direction = Right
- Shift Amount = 2 positions
- Result = -2 (Binary: 11111110)
- Calculation Type: Signed Division by 4
Example 4: Multiple Left Shifts
- Original Number = 3 (Binary: 0011)
- Shift Direction = Left
- Shift Amount = 3 positions
- Result = 24 (Binary: 11000)
- Calculation Type: Multiplication by 8
Example 5: Zero Extension
- Original Number = 7 (Binary: 0111)
- Shift Direction = Right
- Shift Amount = 2 positions
- Result = 1 (Binary: 0001)
- Calculation Type: Division by 4
What is Bit Shift?
A Bit Shift is a Binary Operation that moves the bits of a number left or right by a specified number of positions. Left Shifts effectively multiply the number by powers of two, while Right Shifts divide by powers of two. Logical Shifts always fill vacant positions with zeros, while Arithmetic Shifts preserve the number’s sign during right shifts.