# Express a binary operation in decimal

Is there a way to represent binary operation in decimal. What I mean with this is for example a set of decimal operators that would give the same result as a x>>n a ror(x), etc. So far the only thing I reached is that $\ x>>1_{2}$ would be a $\sqrt x_{10}$ and the reverse $\ x<<1_{2}$ is $\ x^2_{10}$

EDIT:

Not sure but I would venture to say that a ROR operation would be something like $\mod(\sqrt x_{10}, 2^n)$ where n is the number of bits of the binary representation.

Shifting number $x$ right gives you $x/2$ (rounded down) and left - $2x$.
In case of ROR (I believe you meant a circular shift) you have the following: $$x>>1 = \begin{cases} x/2 & \text{if } x_{10} = 2k \\ x/2 + 2^{N-1} & \text{if } x_{10} = 2k +1 \end{cases}$$ $$x<<1 = \begin{cases} 2x & \text{if } x_{10} < 2^{N-1} \\ 2(x -2^{N-1}) + 1 & \text{if } x_{10} \geq 2^{N-1} \end{cases}$$
Where $n$ is a bit lenght of $x$. You may simple get $x>>n$ and $x<<n$, $\forall n \in \mathbb N$ from here.
• Not sure these functions would have a good, useful representation, as bitwise AND or XOR work with single bits, so you couldn't avoid converting number from DEC to BIN (or present your number as a sum of $a_i2^i$, $i = 0, 1, ... , N-1$ which is virtually the same as converting from DEC to BIN). – Andrei Rykhalski Oct 9 '14 at 12:18