anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:I remembered someone telling me that, in the technology of the day
John Levine <johnl@taugh.com> writes:
Even though the 704's regualar arithmetic was sign-magnitude, itsMy current theory is that 2's complement was known as a technique for
index arithmetic was two's complement subtraction. People certainly
knew about two's complement, dunno why they stuck with one's comp so long. >>
subtracting unsigned numbers (and earlier using 10's complement for
mechanical computing machines), and that was used just for unsigned
numbers for quite a while on many computers, e.g., on the IBM 704 or
the PDP-4.
The idea of interpreting numbers with set MSB as negative numbers by
subtracting 2^n from their unsigned value, and relying on the
properties of modular arithmetic to make this work with the same
addition, subtraction, multiplication, and shift-left operations that
were also used for unsigned arithmetic was apparently only becoming
widespread in the early 1960s. It's not an obvious idea.
Once that idea was widespread, people designed their new product lines
with 2s-complement representation of signed numbers.
However, ones-complement is not obvious, either. How did that become
widespread?
When an integer adder was spread over several plug in logic boards,
the end-around carry of 1s-complement was no hinderance to ADD perf
(as it became when the whole data path was in one die).
1s-complment had MUL & DIV 2^n for free, and symmetrical -# ranges.
On 10/3/2026 4:49 PM, MitchAlsup wrote:
I remembered someone telling me that, in the technology of the day (individual transistors on plug in logic cards) that for the Univac
anton@mips.complang.tuwien.ac.at (Anton Ertl) posted:
John Levine <johnl@taugh.com> writes:
Even though the 704's regualar arithmetic was sign-magnitude, its
index arithmetic was two's complement subtraction.-a People certainly
knew about two's complement, dunno why they stuck with one's comp so
long.
My current theory is that 2's complement was known as a technique for
subtracting unsigned numbers (and earlier using 10's complement for
mechanical computing machines), and that was used just for unsigned
numbers for quite a while on many computers, e.g., on the IBM 704 or
the PDP-4.
The idea of interpreting numbers with set MSB as negative numbers by
subtracting 2^n from their unsigned value, and relying on the
properties of modular arithmetic to make this work with the same
addition, subtraction, multiplication, and shift-left operations that
were also used for unsigned arithmetic was apparently only becoming
widespread in the early 1960s.-a It's not an obvious idea.
Once that idea was widespread, people designed their new product lines
with 2s-complement representation of signed numbers.
However, ones-complement is not obvious, either.-a How did that become
widespread?
When an integer adder was spread over several plug in logic boards,
the end-around carry of 1s-complement was no hinderance to ADD perf
(as it became when the whole data path was in one die).
1s-complment had MUL & DIV 2^n for free, and symmetrical -# ranges.
1107, ones complement was faster, but I couldn't find a reference for that.-a I was talking about this with another Univac "old timer", and he sent me a paper copy of a talk given at the 25th anniversary USE
conference (the Univac user's group)
"Scientists and engineers demanded both precision and mathematical >consistency." The result was both the 36 bit word and the use of >mathematical representation that provided complete symmetry of positive
and negative numbers. All of these machines used a numeric
representation that had an equal number of positive and negative numbers
and had both plus and minus zeros. These requirements are still present >today in the form of the IEEE floating point standard. The IBM , GE and
DEC machines used a signed-magnitude representation in which the sign
bit was just that/ The Sperry Rand Univac systems used a
ones-complement representation because it permitted faster addition and >subtraction with less hardware. A complement cycle was not needed for
most operations."
Of course, the paper doesn't explain why the requirement for symmetry
seemed to go away and two's complement became acceptable.
a talk given at the 25th anniversary USE
conference (the Univac user's group) titled "Why it is the way it is",
by Ron Q Smith, then a long time and well respected Univac employee. It >goes through the requirement by the military for 36 bit words, due to >needing eight digits of floating point precision, rather than the 6
digits that 32 bits would provide
"Scientists and engineers demanded both precision and mathematical >consistency." The result was both the 36 bit word and the use of >mathematical representation that provided complete symmetry of positive
and negative numbers. All of these machines used a numeric
representation that had an equal number of positive and negative numbers
and had both plus and minus zeros.
Of course, the paper doesn't explain why the requirement for symmetry
seemed to go away and two's complement became acceptable.
According to Stephen Fuld <sfuld@alumni.cmu.edu.invalid>:
"Scientists and engineers demanded both precision and mathematical >consistency." The result was both the 36 bit word and the use of >mathematical representation that provided complete symmetry of positive >and negative numbers. All of these machines used a numeric
representation that had an equal number of positive and negative numbers >and had both plus and minus zeros. These requirements are still present >today in the form of the IEEE floating point standard. The IBM , GE and >DEC machines used a signed-magnitude representation in which the sign
bit was just that/ The Sperry Rand Univac systems used a
ones-complement representation because it permitted faster addition and >subtraction with less hardware. A complement cycle was not needed for >most operations."
The DEC PDP-10 had two's complement floating point but otherwise yes.
That last sentence is true compared to sign-magnitude but it did need end-around carry.
Of course, the paper doesn't explain why the requirement for symmetry >seemed to go away and two's complement became acceptable.
IEEE floating point is still sign-magnitude since among other things that enables the hidden bit so you get more precision almost for free.
My guess is that for fixed point arithmetic, experience told people
that having to account for two versions of zero was a pain, while the
fact that the largest negative number had no positive representation
didn't matter.
According to Stephen Fuld <sfuld@alumni.cmu.edu.invalid>:
Of course, the paper doesn't explain why the requirement for symmetry >>seemed to go away and two's complement became acceptable.
My guess is that for fixed point arithmetic, experience told people
that having to account for two versions of zero was a pain, while the
fact that the largest negative number had no positive representation
didn't matter.
In what kind of arithmetic world does -i == i ???
The story I have read is that the requirement was 10 digits of
fixed-point numbers, although 34 bits plus sign bit would have been
enough for that. That is supported by the fact that the IBM 701 has
36-bit words, but no floating-point.
Also, von Neumann was an
advocate agains floating point, and I expect that he had quite a bit
of influence on such requirements at the time.
On Mon, 02 Nov 2026 20:00:28 GMT, MitchAlsup <user5857@newsgrouper.org.invalid> wrote:
In what kind of arithmetic world does -i == i ???
Unless i=0, -i never equals i, that's true.
On the other hand, if you use that letter in it's usual meaning as a constant, while i doesn't _equal_ -i, i is _isomorphic_ to -i... and
to j, -j, k, and -k, if you want to include Hamilton's quaternions.
Except for some specific functions that explicitly use i in their definitions, just about everything in mathematics would be the same if--- Synchronet 3.22a-Linux NewsLink 1.2
you consistently swapped i and -i everywhere they were used.
John Savard
On Mon, 02 Nov 2026 19:14:49 GMT, anton@mips.complang.tuwien.ac.at
(Anton Ertl) wrote:
The story I have read is that the requirement was 10 digits of
fixed-point numbers, although 34 bits plus sign bit would have been
enough for that. That is supported by the fact that the IBM 701 has
36-bit words, but no floating-point.
The IBM 701 could do 36-bit arithmetic, but it was an 18-bit machine.
--- Synchronet 3.22a-Linux NewsLink 1.2Also, von Neumann was an
advocate agains floating point, and I expect that he had quite a bit
of influence on such requirements at the time.
Hardware floating-point required quite a few logic gates to implement.
So recommending that programmers work a little harder instead of the
computer trying to do their work for them... made perfect sense back
then, when computers were made out of *vacuum tubes*.
Later, IBM made the IBM 704, which was much larger and more complex
than the IBM 701. It had core memory instead of Williams tubes - both
forms of memory were genuinely random-access, but core memory was much
more reliable. It also had hardware floating-point; this was a bold
move at the time, but it turned out to contribute to the machine's
success. And, of course, the IBM 704 was also the machine for which
the first FORTRAN compiler was written. FORTRAN wasn't the first
higher-level language, but because its compiler performed
optimization, it overcame a lot of the previous opposition to
higher-level languages as wasteful.
John Savard
"Scientists and engineers demanded both precision and mathematical consistency." The result was both the 36 bit word and the use of
mathematical representation that provided complete symmetry of
positive and negative numbers. ..."
Of course, the paper doesn't explain why the requirement for
symmetry seemed to go away and two's complement became acceptable.
On Mon, 02 Nov 2026 19:14:49 GMT, anton@mips.complang.tuwien.ac.at
(Anton Ertl) wrote:
The story I have read is that the requirement was 10 digits of
fixed-point numbers, although 34 bits plus sign bit would have been
enough for that. That is supported by the fact that the IBM 701 has
36-bit words, but no floating-point.
The IBM 701 could do 36-bit arithmetic, but it was an 18-bit machine.
Also, von Neumann was an
advocate agains floating point, and I expect that he had quite a bit
of influence on such requirements at the time.
Hardware floating-point required quite a few logic gates to implement.
So recommending that programmers work a little harder instead of the
computer trying to do their work for them... made perfect sense back
then, when computers were made out of *vacuum tubes*.
quadibloc@invalid.com (John Savard) posted:
On Mon, 02 Nov 2026 20:00:28 GMT, MitchAlsup
<user5857@newsgrouper.org.invalid> wrote:
In what kind of arithmetic world does -i == i ???
Unless i=0, -i never equals i, that's true.
On the other hand, if you use that letter in it's usual meaning as a
constant, while i doesn't _equal_ -i, i is _isomorphic_ to -i... and
to j, -j, k, and -k, if you want to include Hamilton's quaternions.
I is just an integer.
signed char i = 0xFF;
signed char j = -i;
if( i == j ) // WTF
NEGMAX == -NEGMAX in 2-s complement.
I submit this is a lot stranger than having 2 zeros.
quadibloc@invalid.com (John Savard) posted:
On Mon, 02 Nov 2026 19:14:49 GMT, anton@mips.complang.tuwien.ac.at
(Anton Ertl) wrote:
The story I have read is that the requirement was 10 digits of
fixed-point numbers, although 34 bits plus sign bit would have been
enough for that. That is supported by the fact that the IBM 701 has
36-bit words, but no floating-point.
The IBM 701 could do 36-bit arithmetic, but it was an 18-bit machine.
PDP-8 could do floating point arithmetic but had no FP instructions
nor FP registers.
John Savard <quadibloc@invalid.com> schrieb:
On Mon, 02 Nov 2026 19:14:49 GMT, anton@mips.complang.tuwien.ac.at
(Anton Ertl) wrote:
The story I have read is that the requirement was 10 digits of >>>fixed-point numbers, although 34 bits plus sign bit would have been >>>enough for that. That is supported by the fact that the IBM 701 has >>>36-bit words, but no floating-point.
The IBM 701 could do 36-bit arithmetic, but it was an 18-bit machine.
Also, von Neumann was an
advocate agains floating point, and I expect that he had quite a bit
of influence on such requirements at the time.
Von Neumann was also opposed to assemblers, he considered them a
waste of valuable computer time, and wanted people to program in
machine code.
Hardware floating-point required quite a few logic gates to implement.
So recommending that programmers work a little harder instead of the
computer trying to do their work for them... made perfect sense back
then, when computers were made out of *vacuum tubes*.
Not really.
Before FORTRAN, Backus implemented "Speedcoding", which was an
interpeter for a sort of assembly language which did floating point.
Despite its name, it was very slow, but the savings in overall time
often made the total time to solution faster, and it was apparently
pleasant enough to use so people did it.
IIUC big motivation for FORTRAN was hardware floating point.
Namely, with software floating point actual arithmetic dominated
run time and overhead of interpretation was acceptable. But
with hardware floating point arithmetic was faster and relative
role of overhead was much larger. That is why FORTRAN team
worked hard to produce efficient code.
I remembered someone telling me that, in the technology of the day (individual transistors on plug in logic cards) that for the Univac
1107, ones complement was faster, but I couldn't find a reference for
that.
I was talking about this with another Univac "old timer", and he
sent me a paper copy of a talk given at the 25th anniversary USE
conference (the Univac user's group) titled "Why it is the way it is",
by Ron Q Smith, then a long time and well respected Univac employee. It goes through the requirement by the military for 36 bit words, due to needing eight digits of floating point precision, rather than the 6
digits that 32 bits would provide and mentions that other computers of
the day such as the IBM 7090 and 7094, GE systems and PDP 10 that used
36 bits. It then goes on to make an argument that I hadn't heard before.
"Scientists and engineers demanded both precision and mathematical consistency." The result was both the 36 bit word and the use of mathematical representation that provided complete symmetry of positive
and negative numbers. All of these machines used a numeric
representation that had an equal number of positive and negative numbers
and had both plus and minus zeros. These requirements are still present today in the form of the IEEE floating point standard. The IBM , GE and
DEC machines used a signed-magnitude representation in which the sign
bit was just that/ The Sperry Rand Univac systems used a
ones-complement representation because it permitted faster addition and subtraction with less hardware. A complement cycle was not needed for
most operations."
Of course, the paper doesn't explain why the requirement for symmetry
seemed to go away and two's complement became acceptable.
Of course, the paper doesn't explain why the requirement for symmetry
seemed to go away and two's complement became acceptable.
The IBM 704 compared -0 as smaller than +0...
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
I remembered someone telling me that, in the technology of the day (individual transistors on plug in logic cards) that for the Univac
1107, ones complement was faster, but I couldn't find a reference for that.
I have also read the claim, but I think it bogus. An end-around-carry
takes time.
That may not matter when your adder is made of vacuum tubes and
your memory is made of cores, which are much slower, so you have
time for two ripple-carry round trips in one cycle.
This, I believe,
was the case for the IBM 704 (I found literature for the 701).
A couple of decades later: I found a mention on Wikipedia that the
SuperNova SC, which ran at semiconductor memory speeds, was the
fastest mini for some time. The adders must have been fast enough.
I was talking about this with another Univac "old timer", and he
sent me a paper copy of a talk given at the 25th anniversary USE conference (the Univac user's group) titled "Why it is the way it is",
by Ron Q Smith, then a long time and well respected Univac employee. It goes through the requirement by the military for 36 bit words, due to needing eight digits of floating point precision, rather than the 6
digits that 32 bits would provide
and mentions that other computers of
the day such as the IBM 7090 and 7094, GE systems and PDP 10 that used
36 bits. It then goes on to make an argument that I hadn't heard before.
"Scientists and engineers demanded both precision and mathematical consistency." The result was both the 36 bit word and the use of mathematical representation that provided complete symmetry of positive and negative numbers. All of these machines used a numeric
representation that had an equal number of positive and negative numbers and had both plus and minus zeros. These requirements are still present today in the form of the IEEE floating point standard. The IBM , GE and DEC machines used a signed-magnitude representation in which the sign
bit was just that/ The Sperry Rand Univac systems used a
ones-complement representation because it permitted faster addition and subtraction with less hardware. A complement cycle was not needed for most operations."
Of course, the paper doesn't explain why the requirement for symmetry seemed to go away and two's complement became acceptable.
The IBM 704 compared -0 as smaller than +0...
Thomas Koenig <tkoenig@netcologne.de> posted:
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
I remembered someone telling me that, in the technology of the day
(individual transistors on plug in logic cards) that for the Univac
1107, ones complement was faster, but I couldn't find a reference for
that.
I have also read the claim, but I think it bogus. An end-around-carry
takes time.
The gate delay count of 1s-complement and 2s-complement are identical.
It was only when the end-around carry came out of the data-path at the
top and went in at the bottom that 1s-complement was seen to be slower
than 2s-complement. With "a couple of bits per logic board" and the
ability to place the boards anywhere <within reason> end-around-carry
was no slower than 2s-complement. So, prior to VLSI, the 2 adders were essentially identical in gate count, speed, and power.
That may not matter when your adder is made of vacuum tubes and
your memory is made of cores, which are much slower, so you have
time for two ripple-carry round trips in one cycle.
Literally, the gate-count and gate-delay latency are identical.
This, I believe,
was the case for the IBM 704 (I found literature for the 701).
A couple of decades later: I found a mention on Wikipedia that the
SuperNova SC, which ran at semiconductor memory speeds, was the
fastest mini for some time. The adders must have been fast enough.
I was talking about this with another Univac "old timer", and he
sent me a paper copy of a talk given at the 25th anniversary USE
conference (the Univac user's group) titled "Why it is the way it is",
by Ron Q Smith, then a long time and well respected Univac employee. It >>> goes through the requirement by the military for 36 bit words, due to
needing eight digits of floating point precision, rather than the 6
digits that 32 bits would provide
4-bits is only 1.3 decimal digits--not 2.0
and mentions that other computers of >>> the day such as the IBM 7090 and 7094, GE systems and PDP 10 that used
36 bits. It then goes on to make an argument that I hadn't heard before. >>>
"Scientists and engineers demanded both precision and mathematical
consistency." The result was both the 36 bit word and the use of
mathematical representation that provided complete symmetry of positive
and negative numbers. All of these machines used a numeric
representation that had an equal number of positive and negative numbers >>> and had both plus and minus zeros. These requirements are still present >>> today in the form of the IEEE floating point standard. The IBM , GE and >>> DEC machines used a signed-magnitude representation in which the sign
bit was just that/ The Sperry Rand Univac systems used a
ones-complement representation because it permitted faster addition and
subtraction with less hardware. A complement cycle was not needed for
most operations."
For the record, S.E.L machines {32/65, 32/67, and 32/87} all used 2s- complement FP in <otherwise> IBM Hex exponent and normalization.
Of course, the paper doesn't explain why the requirement for symmetry
seemed to go away and two's complement became acceptable.
The IBM 704 compared -0 as smaller than +0...
So, does IEEE total_order( -0, +0 );
Thomas Koenig <tkoenig@netcologne.de> posted:
Stephen Fuld <sfuld@alumni.cmu.edu.invalid> schrieb:
I remembered someone telling me that, in the technology of the day
(individual transistors on plug in logic cards) that for the Univac
1107, ones complement was faster, but I couldn't find a reference for
that.
I have also read the claim, but I think it bogus. An end-around-carry
takes time.
The gate delay count of 1s-complement and 2s-complement are identical.
It was only when the end-around carry came out of the data-path at the
top and went in at the bottom that 1s-complement was seen to be slower
than 2s-complement. With "a couple of bits per logic board" and the
ability to place the boards anywhere <within reason> end-around-carry
was no slower than 2s-complement. So, prior to VLSI, the 2 adders were essentially identical in gate count, speed, and power.
That may not matter when your adder is made of vacuum tubes and
your memory is made of cores, which are much slower, so you have
time for two ripple-carry round trips in one cycle.
Literally, the gate-count and gate-delay latency are identical.
This, I believe,
was the case for the IBM 704 (I found literature for the 701).
A couple of decades later: I found a mention on Wikipedia that the
SuperNova SC, which ran at semiconductor memory speeds, was the
fastest mini for some time. The adders must have been fast enough.
I was talking about this with another Univac "old timer", and he
sent me a paper copy of a talk given at the 25th anniversary USE
conference (the Univac user's group) titled "Why it is the way it is",
by Ron Q Smith, then a long time and well respected Univac employee. It >>> goes through the requirement by the military for 36 bit words, due to
needing eight digits of floating point precision, rather than the 6
digits that 32 bits would provide
4-bits is only 1.3 decimal digits--not 2.0
4-bits is only 1.3 decimal digits--not 2.0
Yes. It looks like the paper erred in that 32 bits, with its 24 bits of >mantissa provides seven digits of precision, not six. But Univac's 36
bit single precision, with its 27 bits of mantissa does provide eight
digits of precision.
They also made an 18-bit computer, the PDP-4 (which had compatible
successors in the PDP-9 and PDP-15) which had a set of one's
complement instructions and an additional set of two's complement >instructions. I guess that let those machines act as bridges between
hardware which was either one way or the other.
They also made an 18-bit computer, the PDP-4 (which had compatible
successors in the PDP-9 and PDP-15) which had a set of one's
complement instructions and an additional set of two's complement >instructions. I guess that let those machines act as bridges between
hardware which was either one way or the other.
They
added two's complement arithmetic because the users wanted to do
multiple precision and floating point arithmetic with more than 18
bits which is a lot easier to do in two's complement. It also added a
"link" bit to hold the carry out of the accumulator, and instructions
to test it so you could do something like this for a two word addition
CLA A / low part
TAD B / carry is in the link bit
DAC C
CLA A+1 / high part
SZL / skip on zero link
IAC / add 1 to AC if there was a carry
TAD B+1
DAC C+1
John Levine <johnl@taugh.com> writes:
[PDP-4]
They
added two's complement arithmetic because the users wanted to do
multiple precision and floating point arithmetic with more than 18
bits which is a lot easier to do in two's complement. It also added a
"link" bit to hold the carry out of the accumulator, and instructions
to test it so you could do something like this for a two word addition
CLA A / low part
TAD B / carry is in the link bit
DAC C
CLA A+1 / high part
SZL / skip on zero link
IAC / add 1 to AC if there was a carry
TAD B+1
DAC C+1
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.
I am sure that one can do an addition with carry-in and carry-out on
the PDP-4, but the sequence is even longer than the five-instruction
sequence of MIPS, Alpha, and RISC-V. This is an interesting contrast
to the 6502, where the only addition available is an addition with
carry-in and carry-out (likewise for subtraction), and if you do not
want the carry-in, you ensure that the carry-bit is clear before the
ADC instructon (e.g., with the CLC instruction). If the main reason
for the TAD instruction in the PDP-4 is double-precision or multiple-precision integer arithmetics, it probably would have been
better to go for a TADC (two's-complement addition with carry-in and carry-out) instead.
According to John Savard <quadibloc@invalid.com>:
They also made an 18-bit computer, the PDP-4 (which had compatible >>successors in the PDP-9 and PDP-15) which had a set of one's
complement instructions and an additional set of two's complement >>instructions. I guess that let those machines act as bridges between >>hardware which was either one way or the other.
The DEC Computer Engineering book says that the PDP-4 was designd to
be a lower cost PDP-1, 5/8 of the performance for half the cost. They
added two's complement arithmetic because the users wanted to do
multiple precision and floating point arithmetic with more than 18
bits which is a lot easier to do in two's complement. It also added a
"link" bit to hold the carry out of the accumulator, and instructions
to test it so you could do something like this for a two word addition
CLA A / low part
TAD B / carry is in the link bit
DAC C
John Levine <johnl@taugh.com> writes:
[PDP-4]
They
added two's complement arithmetic because the users wanted to do
multiple precision and floating point arithmetic with more than 18
bits which is a lot easier to do in two's complement. It also added a
"link" bit to hold the carry out of the accumulator, and instructions
to test it so you could do something like this for a two word addition
CLA A / low part
TAD B / carry is in the link bit
DAC C
CLA A+1 / high part
SZL / skip on zero link
IAC / add 1 to AC if there was a carry
TAD B+1
DAC C+1
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.
- anton
On Alpha you needed to play tricks with predicated instructions, afair
you had two forms of ADD, one that just added two registers and one that
did the same plus an extra increment which represented an incoming carry.
Even on x86/x64 you get into similar situations when you need to add >multiple parts together, it is easy to get stuck with long manual carry >chains.
Possibly the best primitive is MAA (Mul Add Add) representing
(sumlo, sumhi) = muladdadd(f1, f2, a1, a2);
since this can never overflow the two-element result?
According to Stephen Fuld <sfuld@alumni.cmu.edu.invalid>:
"Scientists and engineers demanded both precision and mathematical
consistency." The result was both the 36 bit word and the use of
mathematical representation that provided complete symmetry of positive
and negative numbers. All of these machines used a numeric
representation that had an equal number of positive and negative numbers
and had both plus and minus zeros. These requirements are still present
today in the form of the IEEE floating point standard. The IBM , GE and
DEC machines used a signed-magnitude representation in which the sign
bit was just that/ The Sperry Rand Univac systems used a
ones-complement representation because it permitted faster addition and
subtraction with less hardware. A complement cycle was not needed for
most operations."
The DEC PDP-10 had two's complement floating point but otherwise yes.
That last sentence is true compared to sign-magnitude but it did need end-around carry.
Of course, the paper doesn't explain why the requirement for symmetry
seemed to go away and two's complement became acceptable.
IEEE floating point is still sign-magnitude since among other things that enables the hidden bit so you get more precision almost for free.
My guess is that for fixed point arithmetic, experience told people
that having to account for two versions of zero was a pain, while the
fact that the largest negative number had no positive representation
didn't matter.
John Levine <johnl@taugh.com> writes:
[PDP-4]
They
added two's complement arithmetic because the users wanted to do
multiple precision and floating point arithmetic with more than 18
bits which is a lot easier to do in two's complement. It also added a >>"link" bit to hold the carry out of the accumulator, and instructions
to test it so you could do something like this for a two word addition
CLA A / low part
TAD B / carry is in the link bit
DAC C
CLA A+1 / high part
SZL / skip on zero link
IAC / add 1 to AC if there was a carry
TAD B+1
DAC C+1
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.
Terje Mathisen <terje.mathisen@tmsw.no> writes:
[add with carry-in and carry-out]
On Alpha you needed to play tricks with predicated instructions, afair
you had two forms of ADD, one that just added two registers and one that
did the same plus an extra increment which represented an incoming carry.
No, Alpha is just like MIPS and RISC-V. For RISC-V:
add tmp1, carry, summand1
sltu carry1, tmp1, summand1
add sum, tmp1, summand2
sltu carry2, sum, tmp1
add carry, carry2, carry1
Alpha has no predicated instructions apart from a conditional move and
no addition with an extra increment.
What you describe reminds me of IA-64; it certeinly selects between
a+b and a+b+1 with predication, but I don't remember how it gets the carry-out into a flag.
The DEC Computer Engineering book says that the PDP-4 was designd to
be a lower cost PDP-1, 5/8 of the performance for half the cost. They
added two's complement arithmetic because the users wanted to do
multiple precision and floating point arithmetic with more than 18
bits which is a lot easier to do in two's complement. It also added a >>"link" bit to hold the carry out of the accumulator, and instructions
to test it so you could do something like this for a two word addition
CLA A / low part
TAD B / carry is in the link bit
DAC C
Was this mnemonic really DAC? For the PDP-8, it was DCA
(Deposit and Clear Accumulator).
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).
They
added two's complement arithmetic because the users wanted to do
multiple precision and floating point arithmetic with more than 18
bits which is a lot easier to do in two's complement.
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
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).
The original Nova had a four-bit TI 7483 as an adder.
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.
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
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).
The original Nova had a four-bit TI 7483 as an adder.
And it needed four rounds through that adder for a full-width
addition. That's what I meant.
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 ...
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).
Perhaps a reason for that was that the mainframes started with bigger
word sizes to begin with (32, 36, or even 60 bits) so the pressure to
easily handle multi word arithmetic was less.
However, note that the 1108 in 1965 had a pretty full complement of
double word arithmetic instructions, 72 bit add and subtract, 36*36
giving 72 bit multiplication, and 72 divided by 36 bit giving 36 bit >dividend and remainder.
I *had* wondered why the 6502 got similar performance at 1 MHz as
the Z80 at 3 to 4.
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.
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.
Perhaps a reason for that was that the mainframes started with
bigger word sizes to begin with (32, 36, or even 60 bits) so the
pressure to easily handle multi word arithmetic was less.
However, note that the 1108 in 1965 had a pretty full complement of
double word arithmetic instructions, 72 bit add and subtract, 36*36
giving 72 bit multiplication, and 72 divided by 36 bit giving 36 bit
dividend and remainder. This lessened pressure for multi precision capabilities. Never the less, it supported both carry and overflow
flags and conditional jump instructions to test for them.
I *had* wondered why the 6502 got similar performance at 1 MHz as
the Z80 at 3 to 4.
On Sat, 07 Nov 2026 07:41:34 GMT, Anton Ertl wrote:
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.
I think the only 16-bit address arithmetic operation needed was adding
1 to the program counter. All the index registers were 8-bit; even the
stack pointer was 8-bit, so there was no need for 16-bit arithmetic on
that (beyond prepending a fixed high byte of 1 to construct the
current top-of-stack address).
--- Synchronet 3.22a-Linux NewsLink 1.2The 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.
Obviously such a feature had no value in mainframe COBOL rCLbusinessrCY >programming, did it ... ?
On Sat, 7 Nov 2026 22:33:05 -0000 (UTC), Lawrence D-|Oliveiro <ldo@nz.invalid> wrote:
On Sat, 07 Nov 2026 07:41:34 GMT, Anton Ertl wrote:
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.
I think the only 16-bit address arithmetic operation needed was adding
1 to the program counter. All the index registers were 8-bit; even the
stack pointer was 8-bit, so there was no need for 16-bit arithmetic on
that (beyond prepending a fixed high byte of 1 to construct the
current top-of-stack address).
All the 6502's indexed addressing modes required 16-bit arithmetic.
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.
Obviously such a feature had no value in mainframe COBOL rCLbusinessrCY
programming, did it ... ?
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
Thomas Koenig <tkoenig@netcologne.de> writes:
Anton Ertl <anton@mips.complang.tuwien.ac.at> schrieb:
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).
The original Nova had a four-bit TI 7483 as an adder.
And it needed four rounds through that adder for a full-width
addition. That's what I meant.
I only recently learned that the Z80 also has a four-bit ALU, making
two passes for an 8-bit addition.
I *had* wondered why the 6502 got similar performance at 1 MHz as
the Z80 at 3 to 4.
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.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 55:29:00 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,684 |