I tried to solve this challenge by enhancing my skills in digital circuits, but could not solve it.
How can I design a digital circuit where the input is only 2 bits and the output equals 5 times the input.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
If you draw out the truth table it becomes simple.
You have two inputs so there are only four possible output values.
In - Out
00 | 0000
01 | 0101
10 | 1010
11 | 1111
Now look down the columns and you'll see a pattern. You can implement that with no math at all.
If \$x\$ is your number, \$5x = (x + x + x + x + x) = 4x + x \$.
i.e., you have to multiply \$x\$ by \$4\$ and add \$x\$ to it.
Multiplying by \$4\$ (which is \$= 2^2\$) is nothing but shifting \$x\$ to left by two places.
\$x\$ is of two bits, therefore shifting \$x\$ to left by two places make the output \$4\$ bits, with LSbs \$'00'\$.
So what will happen if you add \$x\$ now, and how does MSbs and LSbs will look like after that? The pattern should be obvious. You should be able to come up with the 'circuit' now. In fact, you need only wires.