Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Question about a multiplier.

Status
Not open for further replies.

faye_hongdou

Member level 1
Member level 1
Joined
Nov 21, 2003
Messages
34
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
280
I'm confused about the following code, which is a part of booth multiplier.

Code:

Module CSA24 is a 24-bit carry save adder. And module BTH_25 generates the partial product using booth algorithm. While the PP_CSA is used to accumulate the partial product. My question is that why the (~pp[25]) and (~pp[24]) are used for SUM, but not (pp[25]) and (pp[24]).

Thanks a lot.
 

it seems a signed radix-4 booth algorithm,
can you paste the whole code?
 

i think it should be pp[25] and pp[24] too,
do you simulate the code?
is it right?
by the way, when booth code, if X2 is 1, then sub will be executed instead of add, but there are 3 kinds of possibility, -2, -1, -0,
when -2 and -1, x2 will as carry bit, as you did,
but when -0, it need not, but in your code, it still did, i do not understand
 

I simulated the code, and got the right result.

I still can't understand the statement:
Code:
assign SUM = {~pp[25], ~pp[24], so};
Why the pp[25] and pp[24] is inverted?

and
Code:
wire [25:0] s_00 = {~pp[25], pp0[24:0]};
And why also the pp[25] in s_00 is inverted?

Only inverted the three signal, I can get the right result. Is there any algorithm or theory about this? Is "sign extention" related to this?

Thx
 

sign extention would not inverse
for example in your code
assign PP = (X2) ? ~({26{p2}} & {A, 1'b0} | {26{p1}} & {A[24], A}) :
({26{p2}} & {A, 1'b0} | {26{p1}} & {A[24], A}) ;
{A[24], A}) is sign extention
 

But in SUM signal pp[25] and pp[24] is inverted. Do u know the reason?
 

I think the reason maybe
CSA24 csa24 (.X(I1), .Y(I2), .Z(pp[23:0]), .SUM(so), .CY(co) );
the pp is 26bits, while I1 and I2 are 24bits, normally at first we must extend the signs of I1 and I2 to 26bits and then excute add, but in the code, it process pp[25] and pp[24] after adder,
 
who can tell me the book about booth algorithm?
thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top