snippetMajor
How can I multiply a binary representation by ten using logic gates?
Viewed 0 times
canmultiplygateslogictenbinaryusinghowrepresentation
Problem
So I’m currently working on something and I have converted all decimal digits 0-9 into binary.
But now I want to take say 6 in binary and increase its order of magnitude by base 10 (turning 6 into 60) without converting back to base 10.
Is this possible and if so is there a way to do it with any number, X --> X0 ?
EDIT 1: sorry the first part of the question was super vague and I forgot to mention I’m trying to do this with logic gates.
But now I want to take say 6 in binary and increase its order of magnitude by base 10 (turning 6 into 60) without converting back to base 10.
Is this possible and if so is there a way to do it with any number, X --> X0 ?
EDIT 1: sorry the first part of the question was super vague and I forgot to mention I’m trying to do this with logic gates.
Solution
I assume that the task is to compute $mul(10, a)= 10a$. You don't need to do multiplication. A single binary adder is enough since $$10a = 2^3a + 2a$$
meaning you add one-time left-shifted $a$ to 3-time left-shifted $a$.
For general multiplication $mul(x,y)$ please see this article.
meaning you add one-time left-shifted $a$ to 3-time left-shifted $a$.
For general multiplication $mul(x,y)$ please see this article.
Context
StackExchange Computer Science Q#80677, answer score: 47
Revisions (0)
No revisions yet.