title: What is an assembly shift?
body: <p>I was reading this document: <a href="http://www.fadden.com/techmisc/hdc/lesson11.htm" rel="nofollow noreferrer">http://www.fadden.com/techmisc/hdc/lesson11.htm</a></p>
  
  <p>In it he stated:</p>
  
  <blockquote>
    <p>Problem is, we don't know how long
    these are.  So, we encode the length
    with the unary coding we looked at
    first (colons added for clarity):</p>
  
  <pre><code> value     binary coding
   1         1:
   2         01:0
   3         01:1
   4         001:00
   5         001:01
   16        00001:0000
   64        0000001:000000
   256       000000001:00000000
  </code></pre>
    
    <p>This method is actually floor(log i)
    zeros, followed by a 1, followed by
    the binary code without the leading 1.
    Since the first part is a unary count,
    there is one '0' for every bit in the
    second part.  This means we can
    intersperse the data bits with the
    zeros, like this:</p>
  
  <pre><code> value     binary coding
   1         1
   2         001
   3         011
   4         00001
   5         00011
   16        000000001
   64        0000000000001
   256       00000000000000001
  </code></pre>
    
    <p>This has the same length, but can be
    implemented with a simple shift
    routine (assembly: shift left, if
    carry set then exit, else shift the
    next bit into the integer we're
    forming).</p>
  </blockquote>
  
  <p>What exactly is this assembly shift and is it reversible, meaning can 00000000000000001 go back to 00000000100000000 without extra data?</p>
  
  <p>An animation of an assembly shift would be excellent. Thanks</p>