Given that both A and B are positive integers, the first step is
convert A to the number 1
which is easy:
Multiply by 2 until the highest digit overflows to create a new 1 digit, and erase all the lower digits to just leave a single 1.
The next part
of converting the number 1 to an arbitrary given number B
is hard but can be always done in finitely many steps:
We will be searching for a power of 2 that starts with B. If we find it, we can start from 1, multiply by 2 until we reach that particular power of 2, and erase the last digit until we get B.
The inequality to solve is
$$ B\times 10^m \le 2^n < (B+1)\times 10^m \\ m+\log_{10}{B} \le n \log_{10}{2} < m+\log_{10}(B+1) \\ \text{frac}(\log_{10}{B}) \le \text{frac}(n\log_{10}{2}) < \text{frac}(\log_{10}{(B+1)}) $$
Because $\log_{10}{2}$ is irrational,
the inequality always has an integer solution for $n$. For a number-theoretic argument, choose a sufficiently large prime $p$ so that $k/p$ approximates $\log_{10}{2}$ sufficiently well for some integer $k$. If $m/p$ is inside the given interval, $n=mk^{-1} \text{ mod } p$ is a solution. (I forgot the relevant theorem's details and I'm not sure if this number-theoretic argument is valid, but I'm pretty sure the result still holds.)