Saturday, August 27, 2016

How am I wrong #1.5 RTFM?

Maybe I should just say #2, but this does relate to the last post. I have been reading the manual. Yeah, I know! RTFM? It's the last resort. Usually an admission of defeat. Well, I can't speak to AK (he died in 2006), so I need something to help me with the why's. Why did they do it that way?

I have some answers and there are more to come. When you read a manual, you can only digest so much at a time. Your mind is only ready for one piece of information, not the many that are available, So, you get a fact and internalize it, then you can go back, read it again, and now see the next fact. It was always there, but you couldn't see it the 1st time. You had to 'get' item one, before item 2 could be understood.

OK, another diversion, but necessary. Let's talk about multiplication. Really amazing how long it's been since I tried to multiply 2 numbers by myself. I wanted to  do that because I wanted to discuss multiply with you. I "knew" that multiplying 2 numbers was a process of adding and shifting. "Every" computer guy knows that. Well, old school guys do anyway. So I wanted to think about how WE multiply so I could discuss (briefly) the KI-10's process. (It's possible that a much longer discussion will come later)


So, as we see in the example above, we start by multiplying the 2 against the 756. We see that it is a process where the 2 is multiplied against each more significant digit, adding the carry over from the previous place when needed.
And then we multiply the "3" against the 756, (with the same digit by digit process) but it is SHIFTED over by one digit, one "10's" place.

Well, I didn't mean to write a math text, but we are this far in, so the full digit shift and add is:


The point is to remind you (you did know this once) that a multiply is a process that involves shifting the digits as we go through each step. And FINALLY I get to this point. I don't know how a KI processor multiplies. Well I kinda do, but not completely. I never had to know. I was a maintenance engineer.

When you do a multiply, there is a register that holds the results. (Let's call it the AR or Arithmetic Register, because that what it actually is called) Anyway, the AR holds the starting number, and then the process ADD and SHIFTS that number as required by the "2nd" number. So, the truth is I don't really have to fully understand the "multiply". The multiply is a series of "ADDS" and "SHIFTS".

When something in the KI processor BREAKS (which is all a maintenance engineer cares about), it  will be either the "ADD" or "SHIFT". So in fact, I only had to fix a broken ADD or SHIFT. If I got that correct, the "MULTIPLY" would take care of itself.

So, now, I am in a different place. I am designing a processor. At some point I will actually have to know how the MULTIPLY works. Well, that is not today, but, to get back to the original point, I need to know WHY they wired it the way they did.

Well, at this moment I still don't know WHY there is a 2 place shift right but only a one place shift left., BUT I have seen it discussed in the manual,so I have hope that the answer lies ahead.

What I have found is that there is a reason for wiring in the shifts INSTEAD of using a shift register. Because the output of the ADD can be (because it is wired) placed back into the adjacent bit (left or right), the add and shift can be done in ONE clock tick.

So, all those input mixers, with all that extra chip space, and all that extra wiring means a MULTIPLY is TWICE AS FAST. Shit. I don't want my updated unit to be slower! So, while I haven't come to any final design decisions, I do need to keep in mind that THEY did and ADD and SHIT in one clock tick, not two.

Maybe by the next post I'll know why they have a "2 bit" shift to the right.


3 comments:

  1. Wow, fascinating (even though I just woke up and it was maybe a little too early for Real Math. Next time, I'll have breakfast first.)

    ReplyDelete
  2. I really like your addition table to explain the multiplication process. I don't recall a math teacher demonstrating such a simple visual to reveal multiplication, but then I grew up in a small town.

    PS: Hi Bonnie! Yes, I agree, more coffee please, and it's well after noon for me..

    ReplyDelete
  3. ooh, an actual follower! well, kind of. That last name is a clue there may be other reasons for the connection. Nonetheless, thanks for participating in Gary's relearning 4th grade math class. You will be treated soon to a lesson in binary math you never knew you wanted (after I learn it).

    ReplyDelete