title: Multiplying using Bitwise Operators
body: <p>I was wondering how I could go about multiplying a series of binary bits using bitwise operators. However, I'm interested in doing this to find the a decimal fraction value for the binary value. Here's an example of what I'm trying to do: </p>
  
  <p>Given, say: 1010010,</p>
  
  <p>I want to use each individual bit so that it will be computed as: </p>
  
  <p>1*(2^-1) + 0*(2^-2) + 1*(2^-3) + 0*(2^-4)..... </p>
  
  <p>Though I'm interested in doing this in ARM assembly, having an example in C/C++ will still help as well. </p>
  
  <p>I was thinking of performing a loop with a counter, where each time the loop iterates, a counter will increment, the value will be logically shifted left so that the first bit will be taken, and multiplied by 2^-counter.</p>
  
  <p>However, I'm not entirely sure how I would go about just getting just the first bit/MSB to multiply, and I'm confused as to how I would multiply that value by base 2 to some negative power. </p>
  
  <p>I know that logical shift lefts will multiply it with base two, but those usually have positive exponents. Ex. LSL r0, 2 means the value in r0 will be multiplied by 2^2 = 4. </p>
  
  <p>Thanks in advance!</p>