Understanding output width in signed multipliers

using Xilinx DDS and MULTIPLIER cores, I simulated a system with scalable output. However after the scaler I notice a loss of amplitude of a factor two, even when the output scaler was at maximum positive value (0111..) or minimum negative value (1000..).

Thinking hard, I see that only one case ( 1000... * 1000..) delivers a result with both the top bits different. So if I clip the value range for the scale factor at the low end to exclude 1000..., the second top bit will never be different than the top bit and for an M bit * N bit multiplication using only (M+N-1) bits of the result will not drop any information.

Is that right?

--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Reply to
Uwe Bonnes
Loading thread data ...

Yes.

In a two's-complement multiplication with inputs S+n and S+m, where S represents a sign bit and n, m represent the number of remaining bits, the product will have dimensions 2S+n+m in all cases except

10...0*10...0 (i.e., max neg times max neg). If you can avoid this case, you can throw away the redundant-sign-bit MSB.

How to avoid it? You can, as suggested, use a clipper to limit one of the inputs to a negative value of 10...01. Or if, as is often the case, one of the inputs comes from a coefficient table, you can select/scale your coefficients to avoid the max. negative number.

Obligatory clarification for those who care: In casual conversation (i.e., at parties, coronations, parole hearings) we often refer to the MSB of a two's-comp number as the sign bit. It's more accurate to call it a magnitude bit with a negative weight. For example, the bits in a 4-bit, two's-comp number have weights (from MSB to LSB) of -8, 4,

2, and 1. Looking at two's-comp this way removes a lot of the mystery from two's-comp arithmetic.

Bob Perlman Cambrian Design Works

Reply to
Bob Perlman

Bob Perlman wrote: : Obligatory clarification for those who care: In casual conversation : (i.e., at parties, coronations, parole hearings) we often refer to the : MSB of a two's-comp number as the sign bit. It's more accurate to : call it a magnitude bit with a negative weight. For example, the bits : in a 4-bit, two's-comp number have weights (from MSB to LSB) of -8, 4, : 2, and 1. Looking at two's-comp this way removes a lot of the mystery : from two's-comp arithmetic.

Nice explanation! Thanks

--
Uwe Bonnes                bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Reply to
Uwe Bonnes

Absolutely, Bob. Once my parole officer explained this to me, designing distributed arithmetic multipliers became a walk in the park! Cheers, Syms.

Reply to
Symon

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.