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]).
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 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,