title: bitwise shift in uint
body: <pre><code>uint number = 0x418  in bits : 0000010000011000
  uint number1 = 0x8041 in bits: 1000000001000001
  uint number2 = 0x1804 in bits: 0001100000000100
  </code></pre>
  
  <p>I cannot get 0x8041 with</p>
  
  <pre><code>   number &gt;&gt; 4;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>   (number &gt;&gt; 4) &amp; 0xffff;
  </code></pre>
  
  <p>How I can get 0x8041 and 0x1804 from 0x418 with shift?</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <pre><code>(number &gt;&gt; nbits) | (number &lt;&lt; (16 - nbits))
  </code></pre>