Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!im4u!ut-sally!nather From: nather@ut-sally.UUCP (Ed Nather) Newsgroups: comp.arch Subject: Re: negative addresses (really unsigned arithmetic) Message-ID: <11592@ut-sally.UUCP> Date: 13 May 88 17:18:22 GMT References: <2393@uvacs.CS.VIRGINIA.EDU> <9485@apple.Apple.Com> <965@cresswell.quintus.UUCP> Organization: U. Texas CS Dept., Austin, Texas Lines: 40 In article <965@cresswell.quintus.UUCP>, ok@quintus.UUCP (Richard A. O'Keefe) writes: > > Ah, backgrounds. "unsigned" arithmetic is NOT the same as "arithmetic on > natural numbers" (N as opposed to Z). What it means is "modulo 2^N, > _sort of_". Well, er ... uh ... (blush) ... > I don't imagine that Ed Nather likes it when his counts > silently wrap around from 65535 to 0, but that's "unsigned" arithmetic > for you. In practice my interface board watches for this overflow and yanks on a polled interrupt line so the program can add 1 to an internal 16-bit extension of the count. But you make a strong point: that really isn't the way I'd like things to behave. I guess it's preferable to having 32768 counts represented as a negative number, but not by much. > (2) I am getting sick of computers which cannot do integer arithmetic > and won't admit their mistakes. Floating-point was bad enough, > but when a computer will add 1 to a positive number and give me > a negative number it's time we cleaned up our act. I agree, but I'm pretty sure floating point isn't much of an answer. If I try to count things by adding 1 to a floating point number, as the count gets bigger a unit count becomes less and less significant, until its significance is smaller than the size of the mantissa and counting stops completely. Now, if we designed computers so integer word sizes were large enough to hold the largest number we now use in floating point (ca. 2^512 or so) then we wouldn't need a complex floating point system -- just good, fast (wide) integer operations. And I could count events without constantly looking over my shoulder for problems. -- Ed Nather Astronomy Dept, U of Texas @ Austin {allegra,ihnp4}!{noao,ut-sally}!utastro!nather nather@astro.AS.UTEXAS.EDU