# Why do the left and right shifts of bit operations correspond to decimal multiplication and division

2022-02-02 11:54:24

Why do the left and right shifts of bit operations correspond to decimal multiplication and division , Can you explain it vividly ？

In the case of decimal , Shift left and shift right correspond to multiplication and division . for example 23 Moving one bit to the left is equivalent to filling in ten zeros obtain 230. Isn't it multiplication ？ Same principle of division .
The bit operation shifts left and right, but the base number changes from Decimal 10 Change into 2

Bit operations shift left and right , The cardinality of binary is 2, So for its carry or abdication is multiply 2 Or divide by 2;
Similar to the decimal system, the radix is 10 , therefore Decimal “123” The position power relationship is 123 = 110^2 +210^1 +310^0;
Decimal “123” multiply 10 Then we get 1230 = 1
10^3 +210^2 +310^1+010^0; It's also 10 Shift left under base ;
Similarly, bit operations shift left and right , The cardinality of binary is 2, for example The binary “b0010”（ Decimal system 2）（b0010=1
2^1+02^0） Move left 1 position , have to “b0100”( Decimal system 4)（b0100=12^2+02^1+02^0）, It's equivalent to Move left 1 position , Value times 2.
Move right the same way .