Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In decimal, I have the numbers 4 and 5 for example. I want to concatenate them into the number 45, but then in binary. In decimal, it's just a matter of sticking the numbers together, but I need to do that in binary. I'm not using a programming language, I'm using logical electronic circuitry. But that aside, I need to know how to do it for the general mathematical case if you can call it like that.

4 in decimal = 100 in binary,

5 in decimal = 101 in binary,

45 in decimal = 101101 in binary

As you can see, with binary it's not just a matter of sticking both sequences together. What I need is an explanation of how to get to the answer 45, in binary, by performing arithmetic, number swapping or whatever the two binary sequences that is nessecary.

Thanks for reading, I'd appreciate any help.

share|cite|improve this question
up vote 2 down vote accepted

$(45)_{10}$ (i.e., in decimal) is just $$(45)_{10}=5_{10}((4)_{10}+(5)_{10})$$ $(4)_{10}+(5)_{10}$ is in binary, $(100)_{2}+(101)_2=(1001)_2$. Multiply this by $(101)_2$ to get $$(1001)_2\times (101)_2=(1001)_2+(100100)_2$$ This on addition of course gives $(101101)_2=(45)_{10}$.

share|cite|improve this answer

At the risk of stating the obvious, we have the following.


  1. $b$ is the function that converts from decimal to binary
  2. $d$ is the function that converts from binary to decimal
  3. and $u+v$ is the concatenation of $u$ and $v$ in decimal
  4. and $x \diamond y$ is the operation of interest


$$x \diamond y = b(d(x) + d(y))$$

for all binary strings $x$ and $y$.

I'm not sure if that's what you're looking for, though.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.