[Tfug] Speaking of zero...

Paul Scott waterhorse at ultrasw.com
Mon May 14 14:51:13 MST 2007


William Stott wrote:
> Recently, a conversion on zero was brought up in a class I am taking. The conversation focused on positive and negative values for zero, and what they meant in terms of a computer. Anyone care to throw their ideas into TFUG on this? The instructor said that negative and positive values of zero can cause calculation issues, but he did not elaborate. I am not exactly sure how since the end result seems to be the same. I did see the problem when doing signed magnitude calculations, but only due to the rules in which the book we use gave to us.
>   
The beginning is that there are two kinds of hardware even though there
aren't many examples of one of them (one's complement).

1.  twos complement:  0 (all bits off) is zero, all bits on is -1. 
Lowest possible negative integer is 2**n (n is number of bits) highest
possible positive integer is 2**n - 1

2. ones complement:  all bits off is positive zero, all bits on is
negative zero.  2**n - 1 is largest possible integer, - ( 2**n -1 ) is
most negative number.

(** is exponentiation)

The only example I remember of ones complement computers is the CDC 6000
series.

Paul Scott





More information about the tfug mailing list