What is arithmetic shifting?
What is arithmetic shifting?
Arithmetic Shifting:
An arithmetic shift is an operation to perform multiplication and division by 2 that shifts a binary number either left or right. In both left and right arithmetic shift operations we have to consider the sign bit also. In this the sign bit will not be changed. For positive numbers the sign bit will be 0 and for negative numbers the sign bit will be 1. There are two types of arithmetic shifting:
- Left arithmetic shift
- Right arithmetic shift
Left arithmetic shift
In left arithmetic shift all the bits will be shift left by one position. It performs the operation multiplication. Left arithmetic shift gives the result of multiplies a number by 2. For example-
Let consider the binary number 12:
0 0 0 0 1 1 0 0 now shift the bits left one position
0 0 0 1 1 0 0 0 this is the decimal number 24 = 12 x 2
Step by step
Solved in 3 steps