crandell@ut-sally.UUCP (Jim Crandell) (01/31/84)
Here's my contribution to the ones'- vs. twos'-complement debate. Ones'-complement arithmetic also has the advantage that negation and absolute-value computation can be done extremely expeditiously, which, among its admittedly innumerous helpful implications, boasts the facilitation of very rapid interconversion with sign-magnitude notation. It's also interesting to note that the arithmetic right shift results in a conventional integer division by two in ones' complement, whereas its twos'-complement counterpart, for all its definitional similarity, is equivalent to a ``floor'' division. Furthermore, ones'-complement fractional, fixed-point multiplication cannot overflow (remember that twos'-complement ``fractions'' include -1.0), which is often helpful, not least so when synthesizing floating- point operations. In the spirit of fairness, I should also point out that twos'-complement operations, like unsigned but unlike ones'- complement operations, afford the appropriate treatment of binary angle notation (BAN). BAN represents angles in full rotations with the implicit binary point to the immediate left of the sign position, thus equating .5 (pi radians) and -.5 (-pi radians). (Just as an aside, if you're one of those who believe that fixed-point arithmetic is washed up for ALL numeric applications, I'd like to hear your method for computing the sine of the sum of a number of arbitrary angles.) However, all the above pales in the presence of the unmentioned ramifications of one of the points already cited -- the ease of extending the precision of operations done in twos' complement. I'd like to call attention to an architecture -- the blueprint for a widely divergent family of machines -- which is almost exactly contemporary with that of the 6600, and which has influenced, in monstrous disproportion to any intrinsic merit that it may have, the shape of computer architecture since its time. I refer, of course, to the IBM 360. Now let's suppose that you are to design an architecture with 32-bit registers which performs 32-bit operations on 32-bit data words which may be stored in a memory addressable by the eight-bit unit, and that you are to realize that exact same architecture in either microcode or random logic, as you see fit, on an eight-bit data path for one model, a sixteen-bit data path for another and a 32-bit data path in still another instance. Would you choose ones'- or twos'-complement arithmetic for your instruction set? I wouldn't have to think about that one very long, personally. The expense of working around the inherently poor performance of end-around-carry addition (by, for example, the duplication trick) is just the last straw. Few assertions are less controvertible than that twos'-complement arithmetic is here to stay. On the other hand, I've yet to see a definitive proof that ones'- complement is dead. -- Jim Crandell, C. S. Dept., The University of Texas at Austin {ihnp4,seismo,ctvax}!ut-sally!crandell