Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PDP-11 compat mode [was Re: New Vax - future directions :-)]



On 2021-07-18 00:22, Mouse wrote:
borrowed from).  So you *could* describe it as "(a) borrow into
most significant bit (happened)".
That's a logically consistent point of view.  But it requires that
the "most significant bit" text refer to this one-bit-wider
conceptual value formed by concatenating the complement of C with
the overt operand.

That's not how "most significant bit" works elsewhere in the
document, nor how it works in most other uses I've seen/heard of
such language.

I'm not sure I follow.  [...]

Okay.  I know you too well to write think you just don't have a clear
grasp of binary subtraction, so the problem must lie elsewhere.  Here's
my interpretation, where I'm using 8-bit values for expository ease.

:-)

Right. All agree on what actually do happen, as far as your example goes.

Let me expand it with another example. And I'll just use two bits to make it even shorter.

Subtract 0x3 from 0.

Observe that I am adding a hidden 1 before the first number.

(1) 0 0
    1 1
-------

which, using your notation then becomes:

(1) 0 x
    1
-------
      1

next step we have a problem. We want to subtract 1 from a 0, which is impossible. We need to borrow something into the most significant bit. That comes from our hidden 1.

(0) x x

-------
    1 1

At this point we are done. And at this point, the hidden one have been consumed, or flipped over to a 0. That means that the carry needs to be set, to indicate that we borrowed into the most significant bit. Because we did, since the most significant bit was a 0, and we could not just subtract something from 0.

So we did in fact borrow something into the most significant bit. We borrowed essentially 10 (binary), or 2 (decimal) into the most significant bit, and after the subtraction that then became the 1.

At least to me, it makes total sense to say that you borrowed into the most significant bit here.

We didn't borrow something out. Borrow out don't make any sense to say, in my opinion. We needed some more value in the subtraction to make it possible. We didn't need anything out to complete it. However, if we were to do any extended subtraction on additional bits, we need to know that we did borrow something into this subtraction, which then needs to be taken out of the next, higher bits.

Does that make my view any clearer?

Yes, it makes perfect logical sense to speak of a borrow into the most
significant bit.  But recording that borrow in the condition codes is
not useful, any more than recording the borrow from bit 6 to bit 7
(zero in the above example) is useful.  It's the borrow _out of_ the
most significant bit that is the useful one.

Of course it makes sense to record the borrow into the most significant bit, because if you were to extend the computation to more significant bits, *then* you need to take that borrow out from those higher bits. You will remove some additional value from those higher bits, and thus that is taking something out.

Presumably this differs significantly from your interpretation.  Does
the above help you figure out where we're going astray with respect to
one another?

Not sure. Do my interpretation makes any more sense to you?

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index