Reply by Alexander Kane February 7, 20172017-02-07
On Wednesday, 25 January 2017 05:44:39 UTC+1, Tim Wescott  wrote:
> This is kind of a survey; I need some perspective (possibly historical) > > Are there any digital systems that you know of that use 1's compliment or > signed-magnitude number representation for technical reasons? > > Have you ever used it in the past? > > Is the world down to legacy applications and interfacing with legacy > sensors? > > TIA. > > -- > > Tim Wescott > Wescott Design Services > http://www.wescottdesign.com > > I'm looking for work -- see my website!
I've used sign-magnitude for some compression schemes, in which case the sign bit takes the least significant place. 10 = -1 11 = +1 100 = -2 101 = +2 110 = -3 111 = +3 1000 = -4 ...
Reply by Mike Perkins January 29, 20172017-01-29
On 26/01/2017 01:14, Tim Wescott wrote:
> On Wed, 25 Jan 2017 02:59:46 -0800, cfbsoftware wrote: > >> On Wednesday, January 25, 2017 at 3:14:39 PM UTC+10:30, Tim Wescott >> wrote: >>> This is kind of a survey; I need some perspective (possibly historical) >>> >>> Are there any digital systems that you know of that use 1's compliment >>> or signed-magnitude number representation for technical reasons? >>> >>> Have you ever used it in the past? >>> >>> >> Quote: >> >> "Some designers chose 1’s complement, where −n was obtained from n by >> simply inverting all bits. Some chose 2’s complement, where −n is >> obtained by inverting all bits and then adding 1. The former has the >> drawback of featuring two forms for zero (0…0 and 1…1). This is nasty, >> particularly if available comparison instructions are inadequate. For >> example, the CDC 6000 computers had an instruction that tested for zero, >> recognizing both forms correctly, but also an instruction that tested >> the sign bit only, classifying 1…1 as a negative number, making >> comparisons unnecessarily complicated. This case of inadequate design >> reveals 1’s complement as a bad idea. Today, all computers use 2’s >> complement arithmetic." >> >> Ref: "Good Ideas, Through the Looking Glass" Niklaus Wirth, IEEE >> Computer. Issue No. 01 - January (2006 vol. 39). >> >> https://www.computer.org/csdl/mags/co/2006/01/r1028-abs.html > > I'm looking for current practice, not history.
1's complement is nearly the very definition of history as implied by "Have you ever used it in the past?" The only machine I am aware used 1's complement is a 1970's mainframe. I have not been aware of any since, its a daft idea. -- Mike Perkins Video Solutions Ltd www.videosolutions.ltd.uk
Reply by BobH January 27, 20172017-01-27
 > On 01/26/2017 09:15 PM, rickman wrote:
Snip

 > What does "customer visible" have to do with it?  You seem to be talking
 > about rolling your own DAC using a bunch of I/O pins and resistors with
 > analog inversion circuitry after.  I'm explaining how it can be done
 > more easily.  If you don't need bipolar outputs, why do you need
 > negative binary values at all?
 >
 > I've said there are a few sign magnitude DAC parts out there, but not so
 > many.  I can't recall ever using one.
 >

"Not customer visible" means that the person that buys one of these 
parts to stick on a board is un-aware of the interface between the 
internal digital logic and internal analog circuitry. The people 
designing the analog guts of a mixed signal chip do "roll their own" 
DACs in several flavors. Unless you work in mixed signal IC design or 
test, you would never see these interfaces. For a DAC or ADC product, 
"customer visible" has a lot to do with it because people want 2's 
complement or biased binary at the system interface so that it plays 
nice with the arithmetic in the rest of the system or doesn't confuse 
the firmware people. For internals of a chip, as a digital design 
engineer or test engineer, you just deal with it. As for why it is done 
the way it is, I am not completely sure, it is just what analog 
designers do.

Even fairly analog seeming components like the voltage reference that 
David mentioned generally have a digital section with flash or OTP 
memory that gets read at power up and sets DACs used to configure the 
reference output to the 1% or whatever the part spec is. Bandgaps have 3 
or 4 analog parameters effecting output voltage and output flatness over 
temperature that need to be set. As part of final test on the silicon 
die, they measure the device performance and set the values in the 
memory. This allows the manufacturer to correct for process variations 
and uniformity issues across a wafer the size of a dinner plate. When 
you see "NC" pins on small analog devices, they are often used for the 
access to these memories. The actual signalling methods are pretty 
closely held and not something a customer is likely to stumble on.

The "I/O pins" in use are interconnects between the digital block and 
the analog section on the die. The last chip that I worked on had 100+ 
digital signals crossing the analog/digital boundary. Some were control 
signals and some were trim signals. I think that there were 5 or 6 
parallel interfaced DACs from 4 bits to 11 bits. Of those, 2 or 3 used 
sign magnitude format to pass the trim information across.

BobH
Reply by mac January 27, 20172017-01-27
Well, ther's TCP/ip checksums
Reply by David Brown January 27, 20172017-01-27
On 27/01/17 05:15, rickman wrote:
> On 1/26/2017 8:57 PM, BobH wrote: >> On 01/25/2017 11:15 PM, rickman wrote: >>> On 1/25/2017 11:50 PM, BobH wrote: >>>> On 01/24/2017 09:44 PM, Tim Wescott wrote: >>>>> This is kind of a survey; I need some perspective (possibly >>>>> historical) >>>>> >>>>> Are there any digital systems that you know of that use 1's >>>>> compliment or >>>>> signed-magnitude number representation for technical reasons? >>>>> >>>>> Have you ever used it in the past? >>>>> >>>>> Is the world down to legacy applications and interfacing with legacy >>>>> sensors? >>>>> >>>>> TIA. >>>>> >>>> >>>> I have done hardware dividers and multipliers that only work with >>>> positive integers, so you have to convert to positive values and track >>>> the sign externally. This qualifies as sign magnitude, I think. >>>> >>>> Also, working in mixed analog/digital systems, sign magnitude is pretty >>>> common at the analog/digital boundary. The analog part accepts a >>>> magnitude value and a sign bit. Think about a simple R2R DAC and an >>>> analog transmission gate for accepting the true or inverted value. 2's >>>> complement takes extra work to accept. >>> >>> I don't agree. 2's compliment to a DAC only requires the sign bit to be >>> inverted (same as offsetting by 2**(n-1)) and that the range of the DAC >>> output be biased so the original zero value is at zero volts if that is >>> what is desired. >>> >>> I have seldom seen available analog conversion parts use sign magnitude, >>> but they do exist. >>> >> These are not customer visible interfaces Rick. These are trim DACs used >> for part parameter trimming that the customer never sees or even knows >> that they exist. I spent the last 7 years dealing with this at a couple >> of large semiconductor houses. > > What does "customer visible" have to do with it? You seem to be talking > about rolling your own DAC using a bunch of I/O pins and resistors with > analog inversion circuitry after. I'm explaining how it can be done > more easily. If you don't need bipolar outputs, why do you need > negative binary values at all? > > I've said there are a few sign magnitude DAC parts out there, but not so > many. I can't recall ever using one. >
My understanding of Bob's post here is that the "customer" in this case is the hardware design that is buying the chip, not the end-user or even the board's programmer. So when you buy an ADC with a precision 2.5V internal reference, Bob is talking about the trim DAC that is factory calibrated to modify the base reference - /you/ are the customer for whom this interface is invisible.
Reply by rickman January 27, 20172017-01-27
On 1/26/2017 8:57 PM, BobH wrote:
> On 01/25/2017 11:15 PM, rickman wrote: >> On 1/25/2017 11:50 PM, BobH wrote: >>> On 01/24/2017 09:44 PM, Tim Wescott wrote: >>>> This is kind of a survey; I need some perspective (possibly historical) >>>> >>>> Are there any digital systems that you know of that use 1's >>>> compliment or >>>> signed-magnitude number representation for technical reasons? >>>> >>>> Have you ever used it in the past? >>>> >>>> Is the world down to legacy applications and interfacing with legacy >>>> sensors? >>>> >>>> TIA. >>>> >>> >>> I have done hardware dividers and multipliers that only work with >>> positive integers, so you have to convert to positive values and track >>> the sign externally. This qualifies as sign magnitude, I think. >>> >>> Also, working in mixed analog/digital systems, sign magnitude is pretty >>> common at the analog/digital boundary. The analog part accepts a >>> magnitude value and a sign bit. Think about a simple R2R DAC and an >>> analog transmission gate for accepting the true or inverted value. 2's >>> complement takes extra work to accept. >> >> I don't agree. 2's compliment to a DAC only requires the sign bit to be >> inverted (same as offsetting by 2**(n-1)) and that the range of the DAC >> output be biased so the original zero value is at zero volts if that is >> what is desired. >> >> I have seldom seen available analog conversion parts use sign magnitude, >> but they do exist. >> > These are not customer visible interfaces Rick. These are trim DACs used > for part parameter trimming that the customer never sees or even knows > that they exist. I spent the last 7 years dealing with this at a couple > of large semiconductor houses.
What does "customer visible" have to do with it? You seem to be talking about rolling your own DAC using a bunch of I/O pins and resistors with analog inversion circuitry after. I'm explaining how it can be done more easily. If you don't need bipolar outputs, why do you need negative binary values at all? I've said there are a few sign magnitude DAC parts out there, but not so many. I can't recall ever using one. -- Rick C
Reply by BobH January 26, 20172017-01-26
On 01/25/2017 11:15 PM, rickman wrote:
> On 1/25/2017 11:50 PM, BobH wrote: >> On 01/24/2017 09:44 PM, Tim Wescott wrote: >>> This is kind of a survey; I need some perspective (possibly historical) >>> >>> Are there any digital systems that you know of that use 1's >>> compliment or >>> signed-magnitude number representation for technical reasons? >>> >>> Have you ever used it in the past? >>> >>> Is the world down to legacy applications and interfacing with legacy >>> sensors? >>> >>> TIA. >>> >> >> I have done hardware dividers and multipliers that only work with >> positive integers, so you have to convert to positive values and track >> the sign externally. This qualifies as sign magnitude, I think. >> >> Also, working in mixed analog/digital systems, sign magnitude is pretty >> common at the analog/digital boundary. The analog part accepts a >> magnitude value and a sign bit. Think about a simple R2R DAC and an >> analog transmission gate for accepting the true or inverted value. 2's >> complement takes extra work to accept. > > I don't agree. 2's compliment to a DAC only requires the sign bit to be > inverted (same as offsetting by 2**(n-1)) and that the range of the DAC > output be biased so the original zero value is at zero volts if that is > what is desired. > > I have seldom seen available analog conversion parts use sign magnitude, > but they do exist. >
These are not customer visible interfaces Rick. These are trim DACs used for part parameter trimming that the customer never sees or even knows that they exist. I spent the last 7 years dealing with this at a couple of large semiconductor houses. BobH
Reply by January 26, 20172017-01-26
On Thursday, January 26, 2017 at 11:44:58 AM UTC+10:30, Tim Wescott wrote:
> > > On Wednesday, January 25, 2017 at 3:14:39 PM UTC+10:30, Tim Wescott > > wrote: > >> I need some perspective (possibly historical) > >> > > I'm looking for current practice, not history. >
?????
Reply by David Bridgham January 26, 20172017-01-26
On Thu, 26 Jan 2017 11:07:23 +0000, Allan Herriman wrote:

> Every time you surf the web you use 1's comp arithmetic for the IP and > TCP header checksum calculations. That's just what the spec says. I'm > sure someone at one time thought it had some technical advantage over > other sorts of checksums, but it's actually quite poor in terms of its > error detection capabilities and isn't that fast to calculate.
The ones-complement sum of the 16-bits words is invariant with respect to byte swapping. That is, it just works on either big-endian or little- endian machines. I've never read anything saying that's why they chose it but it's what I've always suspected.
Reply by Allan Herriman January 26, 20172017-01-26
On Tue, 24 Jan 2017 22:44:32 -0600, Tim Wescott wrote:

> This is kind of a survey; I need some perspective (possibly historical) > > Are there any digital systems that you know of that use 1's compliment
or
> signed-magnitude number representation for technical reasons? > > Have you ever used it in the past? > > Is the world down to legacy applications and interfacing with legacy > sensors?
Every time you surf the web you use 1's comp arithmetic for the IP and TCP header checksum calculations. That's just what the spec says. I'm sure someone at one time thought it had some technical advantage over other sorts of checksums, but it's actually quite poor in terms of its error detection capabilities and isn't that fast to calculate. In two different jobs I've designed FPGA-based systems that would alter a field in the IP or TCP header then adjust the checksum to suit rather than recalculating it from scratch. This requires a firm knowledge of 1's comp arithmetic, e.g. you need to know that the +0 and -0 aren't equivalent in this context. As an aside, I once used an HP Ethernet switch didn't do it correctly and would corrupt non-IP frames that happened to have particular values (IIRC it was 0000 or ffff) in the same position as the IP checksum field in the packet header. There are multiple RFCs describing how it's done. Some of them are even correct. Regards, Allan