Converting between decimal and binary
      The basic algorithm: Use the above formula

x = d0 + 2(d1+2(d2+.....+2(dk-1+2dk)...))

and using decimal arithmetic.

            1 x <- dk   (move leftmost digit to x)
            2 i <- k-1 (set index to next digit)
            3 while i > 0 do
            4     x <- di +2x (compute inner product)
            5     i <- i - 1 (decrement index, end while loop)
            6 stop[**]

NOTE: If this conversion algorithm were performed in some other number system (such as octal - base 8, or quinary - base 5) then the resulting representation would be IN THAT BASE system:

For base 5 (quinary) to decimal:

x = d0 + 5(d1+5(d2+.....+5(dk-1+5dk)...))