Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site minn-ua.UUCP
Path: utzoo!linus!security!genrad!grkermit!masscomp!clyde!burl!hou3c!hocda!houxm!ihnp4!stolaf!umn-cs!minn-ua!roger
From: roger@minn-ua.UUCP
Newsgroups: net.arch
Subject: Re: Re: Complement Arithmetic - (nf)
Message-ID: <918@minn-ua.UUCP>
Date: Sun, 29-Jan-84 21:26:14 EST
Article-I.D.: minn-ua.918
Posted: Sun Jan 29 21:26:14 1984
Date-Received: Wed, 1-Feb-84 01:35:30 EST
Sender: notes@minn-ua.UUCP
Organization: Univ. of Minn. Computer Center, Minneapolis
Lines: 48

#R:burdvax:-142500:minn-ua:2700001:000:2252
minn-ua!roger    Jan 29 12:42:00 1984


-----

Regarding the ones vs. twos complement arithmetic discussion:

Having worked on several compilers on both styles of computers, I
would rather work with ones complement arithmetic.  There are many
tricks one can use to generate functional results (e.g. min, max functions)
without using conditional operators (read, tests and jumps).  This
leads to some rather fast code especially on computers like CDC Cybers.
Most of the people who don't like negative zero have either not worked on
a ones complement computer or worked on brain-damaged hardware that generated
negative zero.  The only way to 'generate' a negative zero on a CDC Cyber
is to complement a positive zero, which can be easily avoided (unfortunately,
the hardware will propagate negative zeros but it can't do that if you
don't give it one to start with).  Note that the more pipe-lined the hardware
is the more reason you have to avoid conditional operators.  This trend
is becoming more prevalent as people build faster computers.

A major fault of most twos complement computers is the lack of the required
number of shifts to properly handle sign extension and other such items.
I seem to recall that the number is eight, but I may be mistaken about
that.  A ones complement computer on the other hand only needs two shifts,
a sign-extension right shift (which does work as a divide by 2**n even for
those negative numbers) and a circular shift which is typically implemented
as a left shift.

I agree with the statements that it is difficult to generate multiple
word results with ones complement hardware.  However, the most popular
ones complement computers around (those designed by Seymour Cray) have
60 bit words which are usually adequate all by themselves.  The same
arguments can be used for unsigned arithmetic.

As to why the Cray 1 has twos complement arithmetic, it's because Seymour
couldn't make a ones complement arithmetic section fast enough.  Twos
complement arithmetic is faster which is why it became so prevalent.
The other designers couldn't figure out how to make ones complement
arithemetic sections for their computers which were fast enough.

----

	Roger L. Gulbranson
	University of Minnesota Computer Center
	...ihnp4!stolaf!umn-cs!minn-ua!roger