Arithmetic code: from interval to code value
You transmit the bit pattern of the left(smaller) end, until you either run out of bits or you find a difference of the left and the right (bigger) number.  The first difference will have a 0 on the left side, and a 1 on the right side.  If this 1 is not the last bit on the right side, you transmit this 1 and you are done, you transmitted the shorted number from within the interval. 

a=0011001100
b=0011010010
-&gt;001101


If this 1 is the last bit you cannot transmit it directly, because then you would send exactly the right end which is not within the interval.  In this case you have to continue sending bits from the left side, until you hit the next 0.  Here you transmit a 1, and you are done.

a=00110010101
b=00110011000
-&gt;0011001011