From: Chuck Simmons
Organization: You jest.
X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.0.33 i586)
Subject: Re: DSP 2's complement vs straight binary
References: <3DAF76EE.330238C2@SpamMeSenseless.pergamos.net> <1yVr9.234484$TX5.firstname.lastname@example.org>
Date: Fri, 18 Oct 2002 15:27:23 GMT
NNTP-Posting-Date: Fri, 18 Oct 2002 08:27:23 PDT
> In article >, email@example.com says...
> > Like I was telling John Larkin simply inverting the MSB
> > does not convert straight binary to 2's complement. Here
> > is a website that explains 2's complement.
> > http://www.ibilce.unesp.br/courseware/datas/numbers.htm
> > But you are right, there is hardwire solution for the
> > conversion, but I hate adding extra circuitry to solve a
> > problem like this. In software it looks like it would
> > take a few executions for the conversion, but when we're
> > talking about megabytes of samples it does add up.
> > P.S. I'm looking for a 8 bit sampler.
> How about using a lookup table? Just one operation
> immediately after sampling, and then the samples are stored
> in the desired format.
That's complicated in many DSPs.
The problem is not posed correctly. This is not a conversion from binary
to twos complement. It is a case of subtracting an offset of half of
full scale plus one. If you don't care about the borrow, this is exactly
the same as inverting the MSB.
... The times have been,
That, when the brains were out,
the man would die. ... Macbeth
Chuck Simmons firstname.lastname@example.org