0
\$\begingroup\$

I am new to logical desing and I am not sure how to start the exercise.

The problem:

Assume that we have 2 assinged numbers of 2 bits (A = a1 a0 and B = b1 b0). Desing a combinational logical circuit that computes the S = 4A + 3B and uses half and full adders, only.

What I am thinking is to use 2 full adders to compute the "4 * A", another 2 to compute the "3 * B" and another one to compute the S = 4A + 3B. This mean that I will need 5 full adders in total.

Is this the best and most efficient solution? I guess no but I can't think something better.

Is this diagram right?

enter image description here

\$\endgroup\$
9
  • \$\begingroup\$ Probably not the most optimal solution, but it does the job. And I even believe that is what you are actually required to do. The more advanced solution would be to try to come up with a Boolean function for the expression and try to implement it using adders only. There is no formal method for that. And the result is not guaranteed to be different from the naive one. \$\endgroup\$
    – Eugene Sh.
    Commented Sep 11, 2017 at 16:40
  • \$\begingroup\$ However you decide to approach it remember that you don't have to do anything to multiply a number by 4, just "shift" it twice. Or in other words just wire the value into position 2 bits higher than it started. 11b multiplied by 4 is just 1100b (added two zeros). \$\endgroup\$ Commented Sep 11, 2017 at 16:44
  • \$\begingroup\$ ... And 3B is the same as B+2B, while 2B is shifting as well. So.. looks like you can get away with just two adders :) \$\endgroup\$
    – Eugene Sh.
    Commented Sep 11, 2017 at 16:46
  • \$\begingroup\$ @EugeneSh. Yes shifting could do the job but in order to be able to shift the number don't I need to implement something like Shift Register with D-Flip Flops and a clock? I can't use a clock or a D-Flip Flop \$\endgroup\$
    – George
    Commented Sep 11, 2017 at 16:53
  • 1
    \$\begingroup\$ @George, shifting by a fixed amount can be as simple as just connecting the a1 and a0 inputs to the a3 and a2 inputs of the next adder. \$\endgroup\$
    – The Photon
    Commented Sep 11, 2017 at 16:54

1 Answer 1

2
\$\begingroup\$

First, realize that multiplying a binary number by a power of 2 can be done by simply shifting the number, and no adders are required. Also, 3B can be written as 2B + B.

So your required calculation becomes

     a1 a0  0  0    (4 A)
           b1 b0    (B)
+       b1 b0  0    (2 B)
----------------
  s4 s3 s2 s1 s0

If you notice that it doesn't require an adder to add 0 to something, you can simplify this to

     a1 a0 b1 b0    (4 A + B)
+       b1 b0  0    (2 B)
----------------
  s4 s3 s2 s1 s0

I believe this can be implemented with 2 half-adders and one full-adder, but I'll leave it to you to work out how and to draw it as a schematic diagram.

\$\endgroup\$
15
  • \$\begingroup\$ Nice. Even easier than it looked at first.. \$\endgroup\$
    – Eugene Sh.
    Commented Sep 11, 2017 at 17:13
  • \$\begingroup\$ Yes. Two HA and one FA can achieve it. +1! \$\endgroup\$
    – jonk
    Commented Sep 11, 2017 at 18:02
  • \$\begingroup\$ Thanks for the answer, this way sounds more efficient. I am having a hard time implementing the schematic diagram. Will I need to use something that represents memory like a flip flop? Otherwise how will i remeber the last value to do Val = New_Val + Last_Val. \$\endgroup\$
    – George
    Commented Sep 11, 2017 at 19:35
  • \$\begingroup\$ The resulting expression above is a simple addition. Why would it require memory? It is implemented as asked - using a bunch of adders only \$\endgroup\$
    – Eugene Sh.
    Commented Sep 11, 2017 at 19:40
  • \$\begingroup\$ Because I can't give the whole number at once but 1 bit everytime, right? \$\endgroup\$
    – George
    Commented Sep 11, 2017 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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