Subject: 1's complement arithmetic

From: [email-masked] (Bob Supnik)
Date: 25 APR 94 22:11:30

Here's a question from the deep dark past: how did 1's complement
    arithmetic on the 18b PDP's really work?

    According to the PDP-4 manual, when adding numbers in 1's complement,
    the carry out of the high order bit is propagated back to the low order
    bit to give the correct result:

    	-1	=	777776
    	-1	=	777776
    		     1) 777774
    		     |------>1
    	-2	=	777775

    However, if this is all that happens, then adding a number and its
    complement (x and -x) would always produce -0:

    	-1	=	777776
    	+1	=	000001
    	-0	=	777777

    Did the 18b PDP's automatically convert -0 to +0 as part of (1's
    complement) ADD?  There's a note to that effect in the ISP description
    of the PDP-1 and PDP-4 in "Computer Engineering", but I can't find any
    reference to this in the PDP-4 manual.

Bob Supnik	>[email-masked]
		>All opinions expressed are those of a hardline microcoder
		>and do not reflect those of Digital Equipment Corporation

---

From: [email-masked] (Charles Lasner)
Date: 28 Apr 1994 03:29:20 GMT

Can't say about PDP-1, etc., but the LINC-8, LINC and PDP-12 all just 
allow -0 as 0.  So the AZE is skip on both 0 flavors.  However, APO only 
skips on +0.

Generally speaking, +0 never happens as an arithmetic result, just from 
clearing out something and then leaving it alone.

Additionally, the analog peripherals are actually two's complement.  A 
common display bug is calculating a display point that goes to the other 
end of the screen.  To correctly deal with it, you have to use the LAM 
instruction which is two's complement or use the -8 side if not an 
original LINC.

1's complement also screws up table lookups unless you are calculating an 
offset off of a non-zero base.  Thus tables are not generally placed at 
0000 in a memory segment!

cjl (Not carrying too many ends around!)

---

From: [email-masked] (Sean Case)
Date: 29 Apr 94 12:31:29 GMT

>clearing out something and then leaving it alone.

I take it this means the 1's complement PDPs didn't have a subtractive
adder. Why not?

Sean Case
--
Sean Case                  [email-masked]

"November 11 - Ned Kelly died, ahh shame Fraser shame and we all cried."
        -- The Whitlams, "Gough"