Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-eddie.UUCP Path: utzoo!linus!security!genrad!mit-eddie!smh From: smh@mit-eddie.UUCP (Steven M. Haflich) Newsgroups: net.lang.c,net.arch Subject: Re: One's complement machines and C logic Message-ID: <1233@mit-eddie.UUCP> Date: Sat, 28-Jan-84 10:19:00 EST Article-I.D.: mit-eddi.1233 Posted: Sat Jan 28 10:19:00 1984 Date-Received: Sun, 29-Jan-84 01:10:28 EST References: <537@u1100a.UUCP> Organization: MIT, Cambridge, MA Lines: 22 Back in 1959 a small, young computer company released a new machine, the Programmed Data Processor 1 (PDP1). It is (at least one is still running!) an 18-bit, ones-complement machine. It also had hardware multiply and divide, although that may have been an option and may have appeared later than the original machine. The instruction manual clearly states that the *only* arithmetic operation yielding minus zero is the addition: (+0)+(-0) ==> (-0). (This supports the notion that addition of (+0) is as much an identity operation as an arithmetic operation.) Even in the dark ages, when gates were expensively built of discrete transitors, it was still possible to do things right. Next item: The problem of multiple representations for zero is not unique to ones-complement. Most floating point representations employ a separate sign bit, i.e., sign-magnitude. It is possible to write (-0) as a constant, but floating instructions generally will not produce it. Indeed, the PDP11 provides hardware support for trapping when the FPU fetches (-0). This allows cost-free execution-time checking for computations on uninitialized variables. Steve Haflich, MIT Experimental Music Studio