Article View: comp.arch
Article #560carry-in (was: two's complement and Flags)
From: Anton Ertl
Date: Sat, 07 Nov 2026 07:41
Date: Sat, 07 Nov 2026 07:41
64 lines
4545 bytes
4545 bytes
John Levine <johnl@taugh.com> writes: >It appears that Anton Ertl <anton@mips.complang.tuwien.ac.at> said: [PDP-4] >>That's good enough for double-precision integer arithmetic, but for >>multiple-precision integers, an add with carry-in and carry-out is >>needed. The first sequence only does carry-out, the second only >>carry-in; the second produces a carry, but it does not reflect a >>possible carry-out of the IAC. > >Keep in mind that this computer was designed in 1962, built out of >individual transistors soldered onto PC cards, and had 1K, 4K, or 8K >18 bit words of core memory. Of course more modern instruction sets are >better. I don't think it has anything to do with the materials from which it was built. Turning TAD into TADC (with carry-in) would only have require to use a full adder instead of a half-adder for the lowest bit of the adder and put a wire from the link bit to the carry-in of that full adder. And given that it also has a ones-complement addition, the lowest bit probaly already uses a full adder for the end-around-carry (another reason would be that it may have a narrower (maybe even 1-bit) adder that is used in multiple rounds for a full-width addition, like the original Nova). So the only cost would be to mux the link bit with the end-around-carry depending on the instruction, rather than just masking the end-around carry depending on the instruction. Doing the multiplexing with a wired-or would require one additional gate and two wires; even for a cheap model, the incremental cost would be tiny. The 6502 was also designed to be extremely cheap, and it was designed to be so cheap that it does not even support 16-bit-wide ALU operations despite having 16-bit addresses, but it does include carry-in. They could have shaved off a few more transistors for having only a half-adder for the lowest bit of the ALU, but did not. As for 1962 and more modern instruction sets being better, I think that, yes, they suffered from not having that many good examples to look at, while 64 years later I can point at the 6502 as an example that did this aspect better, while being designed for very low cost, too. S/360 does not have an add with carry-in, either, and IIRC it took until S390 (or S390x?) for them to add it, while microprocessors, having learned the lesson with the 8-bit architectures, usually included add with carry-in and carry-out from the start (with the notable exceptions of MIPS and its descendants). Looking at the PDP-11, it seems to me that again, it supports double-precision arithmetic with the ADC and SBC instructions, but not multiple-precision arithmetics: It splits the add with carry-in into two instructions: ADC and ADD (ADC only adds the carry), but the carries of the two instructions have to be combined with a complex sequence of instructions in order to achieve an add with carry-in and carry-out. The VAX has ADWC, which is a full add with carry-in and carry-out, so the minis eventually learned the lesson, shortly after the micros, and a lot of years before the mainframes. - anton -- 'Anyone trying for "industrial quality" ISA should avoid undefined behavior.' Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Technical Details
Message-ID:
<2026Nov7.084134@mips.complang.tuwien.ac.at>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<10uks4f$1dqo$1@gal.iecc.com> <6ae8eec0.35320218@news.eternal-september.org> <11cjh58$1flq$4@gal.iecc.com> <2026Nov6.072410@mips.complang.tuwien.ac.at> <11cl9d6$464$1@gal.iecc.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: anton@mips.complang.tuwien.ac.at (Anton Ertl) Newsgroups: comp.arch Subject: carry-in (was: two's complement and Flags) Date: Sat, 07 Nov 2026 07:41:34 GMT Organization: Institut fuer Computersprachen, Technische Universitaet Wien Lines: 64 Message-ID: <2026Nov7.084134@mips.complang.tuwien.ac.at> References: <10uks4f$1dqo$1@gal.iecc.com> <6ae8eec0.35320218@news.eternal-september.org> <11cjh58$1flq$4@gal.iecc.com> <2026Nov6.072410@mips.complang.tuwien.ac.at> <11cl9d6$464$1@gal.iecc.com> Injection-Date: Sat, 07 Nov 2026 08:38:01 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3442041"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZENJCgN1NZq3bxdpkgtVR"; posting-host="311f2d42f8002bf9ed9618beacf20f3c" Cancel-Lock: sha1:QPik08mcfyE4qEEfKJj/ytWHZs8= sha256:WdaF80RpcIt0sD6hBgAZY21Xz2KvFjsjr/vsWcwU1c4= sha1:kGfru40DQQGZvzf4DCqMkuROWVw= sha256:6yZTzsu8JcPYYqjAtu+tgVxDsgSQMwEgUe1CccMP7U8= X-newsreader: xrn 10.11