Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site burdvax.UUCP Path: utzoo!linus!philabs!cmcl2!floyd!clyde!akgua!psuvax!burdvax!hopkins From: hopkins@burdvax.UUCP (Bill Hopkins) Newsgroups: net.arch Subject: Re: Complement Arithmetic Message-ID: <1425@burdvax.UUCP> Date: Thu, 26-Jan-84 11:53:53 EST Article-I.D.: burdvax.1425 Posted: Thu Jan 26 11:53:53 1984 Date-Received: Sat, 28-Jan-84 05:47:01 EST Organization: System Development Corporation, Paoli PA Lines: 39 I can recall three main arguments for two's complement arithmetic: - There is a unique representation for each integer in the range represented, [-(2**(n-1))..2**(n-1)-1]. One's complement representation has the infamous and mathematically troublesome "positive and negative zero" problem, which has prematurely aged too many compiler writers. - The arithmetic is the same as for unsigned integers; only the interpretation of carry and overflow change. In one's complement the two require separate ALU operations. - Multiple precision addition and subtraction are simply done by propagating carries (borrows) through status bits. It's virtually impossible to simulate a 32-bit integer operation with a 16-bit ALU in one's complement (consider the end-around carry). My only argument in favor on one's complement is the symmetry of the range, which avoids the possibility of overflow on complementing the most negative number. (There may be others; let's hear from the one's complement freaks out there.) (N.b.: we're only talking integers (really fixed point) because that's how n's-complement arithmetic is defined; floating point representations are made up out of an integer exponent and a fixed point mantissa. The arguments for integers apply to these unchanged. Similarly, multiplication and division are built up out of addition and subtraction.) In the folklore department: The CDC 6000/Cyber-whatever series designed by Seymour Cray use one's complement arithmetic, presumably because he could make it go faster back in the early 60's. The Cray-1 uses two's complement; the folk tale is the Seymour finally figured out how to do it fast. Any confirmation or correction to this tale would be appreciated. Bill Hopkins {presby,psuvax,sdcrdcf}!burdvax!hopkins SDC-Burroughs (215) 648-7578 P.O. Box 517 Paoli, PA 19335 And may all you complements be computable.