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 ?

4

2 回答 2

2

如果你有 2x2->4 乘数,你会得到 4x4->8 乘数,如下所示:

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};

还有更复杂的方法可以通过将数字的部分相乘来乘以完整的数字,例如Karatsuba 算法,但它们可能对硬件乘法没有用。

于 2015-02-11T11:15:06.857 回答
1

请参阅关于如何级联乘法器的 lvds 答案。

乘数的其他几点

请记住,随着输入位宽增长为乘数,乘数大小呈指数增长,因此这不是线性问题。

乘数可以被认为是移位的总和,如果每个移位都由被乘数的位置和值控制,我们可以用移位和一些与门构建一个乘数。

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
于 2015-02-11T08:26:18.973 回答