5
\$\begingroup\$

I need to understand how 3-bit multipliers work and then I must design one. I've read through Wikipedia's binary multiplier but I just can't wrap my head around it. I don't understand where to start. Could you please explain to me what happens when two 3-bit numbers are run through a 3-bit multiplier? Maybe then I can reconstruct each step in a circuit on paper. Alternatively, could you outline the relevant sub-concepts I need to grasp?

In general, I'm thankful for any help in understanding 3-bit multipliers.

EDIT: Thank you to everyone who contributed to this Question. You all helped me understand the relevant concepts, and so I wish I could accept all answers as solutions.

\$\endgroup\$
4
  • \$\begingroup\$ What part of do you not understand from the example given in <en.wikipedia.org/wiki/…>? \$\endgroup\$
    – Greg
    Commented Feb 14, 2014 at 19:52
  • \$\begingroup\$ I think pretty much all of it. I keep reading it but without being able to process it. Probably because I am completely new to digital logic and don't know the terminology. \$\endgroup\$ Commented Feb 14, 2014 at 19:58
  • 3
    \$\begingroup\$ If you're new to digital logic, perhaps you should try to grasp how a binary adder circuit works before a binary multiplier. \$\endgroup\$
    – krb686
    Commented Feb 14, 2014 at 20:02
  • \$\begingroup\$ @krb686 That may be a good idea, I'll do that. \$\endgroup\$ Commented Feb 14, 2014 at 20:04

3 Answers 3

8
\$\begingroup\$

If you're a EE/CPE student and you're just starting to learn logic, maybe you haven't learned this yet but you will.

Arithmetic and logic functions are essentially realized in circuit form by starting with a truth table and filling in the values that implement the function you want. For 2x2 bit multiplication, this is the truth table:

Logic Friday From the program Logic Friday

Go through each row, and you'll see how it implements it. It is in the form A0,A1 * B0,B1 = F0,F1,F2,F3

Sorry, it's backwards as typically the LSB is A0 or B0, I numbered it wrong. Anyways, take for instance the last row. It says 11 * 11 = 1001. In decimal, that's just 3 * 3 = 9

After the truth table is complete, you could fill this into a karnaugh map, and derive the equations for each output of the circuit. In this case, I let this handy program do it for me.

The output came to this.

Logic Friday

At this point, you can see that I have an equation for F0 through F3 based on the inputs. Now I just need to throw in the logic gates to match those equations. And voila, you have a circuit that performs binary multiplication.

This is the simplistic side of it. Real processors and the ALUs inside of them don't exactly do it this way. For instance on a 64-bit computer, the amount of combinational logic necessary to perform 64x64 bit multiplication would be insane. Instead, as the wikipedia article you read states, they multiply one of the 64-bit operands by each individual bit of the 2nd operand, each time shifting the result. Finally, they add all of the partial sums together. That is the absolute most simplistic method of performing the multiplication sequentially. Some processors though have even faster multiply implementations that make use of wallace trees

Also, if you'd like a little more insight on the sequential type multiplier, here you go. This may be a little more difficult so don't worry about understanding how each of the components works underneath, because you will learn it soon. I leared shift registers, ALUs, and all that by the end of my first digital logic course.

http://faculty.kfupm.edu.sa/COE/mimam/files/COE200experiment13.pdf

This image comes from http://faculty.kfupm.edu.sa/COE/mimam/files/COE200experiment13.pdf

This is a simplified 4x4 bit version, and it goes sort of like this:

1) The 4-bit multiplier is loaded and stored in the P shift register, specifically Pl. Also, the 4-bit multiplicand is stored in the B-register. Ph is all 0's

2) On each clock cycle, the P register is shifted to the right, and the rightmost bit, P0, is sign-extended (not shown, to make it 4 bits), and ANDed with the multiplicand in the B-register. If you go back to the binary multiplier page on wikipedia, under multiplication basics, the 2nd grey area, you can see this happening with each staggered row, it is an AND operation that essentially does the multiplication since each time it is either multiplicand x 0, or multiplicand x 1.

Since the ALU is performing the add operation, the result of the 1 bit multiplication is added to the previous partial sum, in this case 0 since this is the first step, and stored in Ph.

3) On the next cycle, the P register is again shifted, and so you can see how the Ph output gets shifted and added again to the result of the 1-bit multiplication.

4) At the end, you have an 8-bit result stored in the p register.

\$\endgroup\$
2
  • \$\begingroup\$ Could you provide citations for the figures in your answer, please? \$\endgroup\$
    – Joe Hass
    Commented Feb 14, 2014 at 21:08
  • \$\begingroup\$ @JoeHass Updated \$\endgroup\$
    – krb686
    Commented Feb 14, 2014 at 21:46
10
\$\begingroup\$

This may not be what you are looking for as far as getting insight into a regular multiplier circuit, but you can implement this easily with just a ROM. All you need is 64 memory loctions, each 6 bits wide. You load the ROM with answers to each of the possible 64 input cases, and the rest is a lookup.

This may sound dismissive, but actually small multiplies and other more complicated functions are often implemented with a lookup table. This would be the normal way to do it inside a FPGA, for example. As the words get wider, the lookup table method becomes impracticle, but for just 3 x 3 it is probably the most appropriate way to implement a multiply in most real cases.

\$\endgroup\$
3
  • \$\begingroup\$ It seems you are describing how to implement multipliers that take 3 numbers of 3 bits each as input. Am I mistaken? I need to build a multiplier that takes two numbers, each of 3 bits. \$\endgroup\$ Commented Feb 14, 2014 at 20:01
  • \$\begingroup\$ If you have two numbers that are three bits wide then you have 6 total bits of information. The answer here is suggesting a lookup table of 2^6 which would hold all the answers, precomputed. \$\endgroup\$
    – David
    Commented Feb 14, 2014 at 20:06
  • \$\begingroup\$ Olin's talking about 3bit*3bit. 3bits=8 possible numbers (2 cubed). 8*8 = 64 total possible outcomes. Read the result at the address of the combination of the inputs (3 bits from op1, 3 bits from op2). \$\endgroup\$ Commented Feb 14, 2014 at 20:08
8
\$\begingroup\$

Write the multiplication down and you'll know what to do. For example A2A1A0×B2B1B0

            A₂   A₁   A₀
         ×  B₂   B₁   B₀
 -----------------------
          B₀A₂ B₀A₁ B₀A₀
+    B₁A₂ B₁A₁ B₁A₀
B₂A₂ B₂A₁ B₂A₀

As you see, just multiply each bit (which is accomplished by an AND) then add them together using full adders. Here is an implementation

3-bit array multiplier

Here is a different way to draw the implementation

another 3-bit multiplier implementation

Most other online examples are 4-bit multipliers but you can modify it easily to make a 3-bit one

\$\endgroup\$
4
  • \$\begingroup\$ Don't you have to plug the carry from the last row, into the Sum in of the next column? I.e, $$\operatorname{Carry_{out}}(A_0B_3) \to\operatorname{Sum_{in}}(A_3B_1),\\ \operatorname{Carry_{out}}(A_1B_3) \to\operatorname{Sum_{in}}(A_3B_2),\\ \operatorname{Carry_{out}}(A_2B_3) \to\operatorname{Sum_{in}}(A_3B_3)?$$ \$\endgroup\$ Commented Dec 10, 2016 at 22:41
  • \$\begingroup\$ @YoTengoUnLCD the carry must be done in hardware. Here I just write out a multiplication like you do on paper. How it's implemented is left for readers \$\endgroup\$
    – phuclv
    Commented Dec 11, 2016 at 3:02
  • \$\begingroup\$ Sorry, I wasn't clear. I meant that in the picture with the 4 by 4 bit multiplier, I believe the carries should be wired as I said above, I tried that circuit a while ago, and it gave a wrong answer for $$0011_2\times 1111_2$$ \$\endgroup\$ Commented Dec 11, 2016 at 3:29
  • \$\begingroup\$ yes may be you're correct. I took the image from internet without checking its content \$\endgroup\$
    – phuclv
    Commented Dec 14, 2016 at 15:42

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.