Tue, 12 Oct 2021, 18:42 Re: Question about Problem Set 3



A student writes:


> Hi there Professor Patt,
>
> I was reviewing problem set 3, and I believe that there is something wrong
> with the key. On question 8 of the problem set, the table shows that in a
> LDR instruction, the MAR is loaded with the computed address in the Fetch
> Operands phase. However, on pages 176-177 of the textbook (right at the end
> of chapter 5 before the practice problems), the textbook has a full example
> of the LDR Instruction Cycle and says that the MAR is loaded during the
> Evaluate Address phase. Which one of these is correct? (Sorry I didn't ask
> this at Sabee's review last night, I hadn't seen that the problem set was
> released)
>
> Thanks,
> <<name withheld to protect the student who is justifiably not sure>>


Thanks for the question.  Shame on me for the inconsistency!  The real
answer is that it depends on how you look at it, and either solution could
be considered correct.  I will, of course, do my best to NOT put you in that
kind of predicament on any exam I give.  Since the MAR is loaded with what is
the address of the data to be loaded (or stored), I think the better answer is
to call that the Evaluate Address phase.  I agree that in an LDR or STR, there
is essentially zero evaluation going on, unlike the LD/ST case where there
certainly is evaluation going on (the offset is added to the PC).  And, I admit
that on some days, I look at the process and think, fetching the data does
involve loading MAR, so I should call that step part of the Fetch Data phase.

I know the above discussion is not helpful since you would rather have it
more precise.  The reality is that what is important is that to fetch data
you need to evaluate the address, load it into the MAR, and then signal the
memory to cough up the contents of the location specified in the MAR. Which
label (evaluate address or fetch data) you stick on the cycle in which you
load the MAR is not important, as long as you understand the sequence that
is necessary to carry out the instruction.

Good luck on the exam.

Yale Patt