0

I want to implement to 4x4 bits multiplier using only 2x2 bits multiplier.

for example, a=1110 b=1011 The 2x2 result is should be 10011010.

I think that I can split like this.

#case 1
a=10
b=11
2x2 multiplier's result = 0110

#case 2
a=11
b=10
2x2 multiplier's result = 0110

I can get the 2 result by using 2x2 multiplier. but how can I make to 4x4 multiplier only using 2x2 multiplier?

But I can't approch to any hint. So how can I make 4x4 multiplier. Does anyone know how to do this? Please help.

In brief, How many 4x4 multiplier would you need to perform an 8x8 multiply. how an 8x8 multiplier would be created using only 4x4 multipliers?

Update :

Is this working? http://blog.pioneermathematics.com/2011/04/26/vedic-trick-on-multiplication/ How ?

Carter
  • 274
  • 2
  • 13

2 Answers2

2

If you have 2x2->4 multipliers, you get 4x4->8 multiplier like this:

wire [3:0] a; // multiplicands
wire [3:0] b; //

wire [3:0] lr;  // partial products
wire [3:0] mr1; //
wire [3:0] mr2; //
wire [3:0] hr;  //

wire [7:0] result; // resulting full product

assign lr  = a[1:0]*b[1:0]; // lowest 4bit partial product
assign mr1 = a[3:2]*b[1:0]; // middle one
assign mr2 = a[1:0]*b[3:2]; // another middle one
assign hr  = a[3:2]*b[3:2]; // highest one

// combine partial products into final product
assign result = {4'd0,lr} + {2'd0,mr1,2'd0} + {2'd0,mr2,2'd0} + {hr,4'd0};

There are also more sophisticated ways to multiply full numbers by multiplying parts of numbers, for example Karatsuba algorithm, but they are probably useless for hardware multiplication.

lvd
  • 793
  • 3
  • 12
  • Thank you very much, Sir. if you can, would you please show how an 8x8 multiplier would be created using only 4x4 multipliers? – Carter Feb 11 '15 at 12:05
  • 1
    @kaji, you should be able to spot the pattern here. 8x8 will take **4** 4x4. It will always take 4 to double the input widths. The LSBs, MSBs the LSB of each against the MSB of the others. – Morgan Feb 11 '15 at 13:51
  • 2
    @lvd impressive, not seen multipliers cascaded like this to make larger ones. We could insert flip-flops between stages to make multi-cycle pipelined multipliers. – Morgan Feb 11 '15 at 15:43
1

See lvds answer on how to cascade multipliers.

Some other points on Multipliers

Bare in mind as the input bit width grows to a multiplier, the multiplier size grows exponentially, therefore this is not a linear problem.

Multipliers can be considered to be a sum of shifts, if each shift is controlled by the position and value of the multiplicand we can build a multiplier out of shifts and some AND gates.

reg [3:0] a;
reg [3:0] b;
reg [7:0] mul;

always @* begin
  // mul = a * b;
  mul = ((a << 3) & {4{b[3]}} )
      + ((a << 2) & {4{b[2]}} )
      + ((a << 1) & {4{b[1]}} )
      + ((a     ) & {4{b[0]}} );
end
Community
  • 1
  • 1
Morgan
  • 19,934
  • 8
  • 58
  • 84
  • Dear Morgan I found some posting here http://blog.pioneermathematics.com/2011/04/26/vedic-trick-on-multiplication/ but I am not sure is this working? How? – Carter Feb 12 '15 at 03:44
  • Sir, is this apply to algebra boolean equation? Can we exchange to algebra boolean equation from above 4x4 binary multiplication? How about this idea? – Carter Feb 12 '15 at 08:27