current position：Home>Why do the left and right shifts of bit operations correspond to decimal multiplication and division
Why do the left and right shifts of bit operations correspond to decimal multiplication and division
2022-02-02 11:54:24 【CSDN Q & A】
Why do the left and right shifts of bit operations correspond to decimal multiplication and division , Can you explain it vividly ？
Refer to the answer 1：
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
Refer to the answer 2：
Refer to the answer 3：
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 = 110^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=12^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 .
Refer to the answer 4：
author[CSDN Q & A],Please bring the original link to reprint, thank you.
The sidebar is recommended
- How to read text from TXT document, write it into excel and run it in reverse?
- Calculation of joint torque of detal manipulator
- Give a string representing the date and ask what day of the year it is
- [Vue] setting @ media to query font size is not effective
- How to use the ecarts national map to the city? I CV changed other people's codes and key values. Now this is the case
- Design database (agricultural products sales database, clothing sales database and stamen sales database)
- Let's see if the course sequence of distributed architect is correct
- What's the matter with me? Please answer
- Link failure of distributed task scheduling
guess what you like
The bean tag calls auto assembly and has been given a parameterless construction Setget, why is class still null
"The column vectors of a matrix whose determinant is equal to zero may not be linearly correlated"
PTA 7-1 string sorting (10 points)
Output the full arrangement of all 1 2 3 4 5 in dictionary order
How to create SQL trigger
Stm32tftlcd displays Chinese character scrolling
The format of the command in the CMD window is unclear
What does the class name in the class mean? It's not a variable or a member function
Seems to have started a program called [com,.] Process. But failed to stop it, which is likely to cause a memory leak. Stack trace for Thread:
Object oriented programming questions
- What are the impossible out of stack sequences when a certain in stack sequence is CADB?
- How to do this!
- Given a matrix of N x n, find the matrix after 90 degrees of rotation
- Mac Pro M1 chip 13 inch how to delete non store software?
- Is there any student to answer the single linked list in the data structure
- On the problem of incomplete display of Vue multi selection box data
- About the problem of incomplete data acquisition in Vue's select multiple selection box
- 360 fast travel assistant how to delete
- What are the experimental equipment and requirements of C language experiment report