title: Storing Binary number in Integer variable
body: <p>I am making a simulator, which simulates the method of multiplication of a processor. The thing is first I have to convert the decimal form to binary, each bit of binary representation is stored at separate location in an array. Now the multiplication of two binary numbers, stored in arrays as mentioned above is very complex and also very memory consuming.</p>
  
  <p>because I have to follow this method;</p>
  
  <p><code>1000</code></p>
  
  <p>x</p>
  
  <p><code>1110</code></p>
  
  <hr>
  
  <pre><code>   `0000`
  
    `1000`
  
   `1000`
  
  `1000`
  </code></pre>
  
  <hr>
  
  <p>=
  1110000</p>
  
  <p>I know that I can easily do this by multiplying decimals forms together and then convert them to binary but unfortunately that's not required here.</p>
  
  <p>I was thinking if there is a way to store the binary number stored in array as a single integer containing binary no. Or any other easy way for multiplying binary bits stored in array. For Example:</p>
  
  <p><code>a[0]=1,a[1]=1, .... ,a[32]=0</code></p>
  
  <p>so I want the integer variable to contain</p>
  
  <p><code>int x=110....0</code></p>
  
  <p>Is there a way to do this?</p>
  
  <p>Regards</p>