in reply to Re^4: converting binary to decimal
in thread converting binary to decimal

The first tr/// converts each digit to the least significant digit you get when you multiply that digit by 2. The second tr/// produces the carry bit for each digit product. The bitwise 'or' adds the carry to the next higher digit (because of the concatenation of the new bit).

It's sort of like how you were doing the multiply by 2, but with a better handling of the carry. Because we are only multiplying by 2 there never will be a chained carry (where a carry causes another carry, similar to 4999+1).