Sun, 8th Nov 2015, 20:33 Re: EE 306 Problem Set 5 question

A student writes, and as it turns out, he understands the data path
much better than he gives himself credit for.  I asked my TAs if I
should forward my response to him to the whole class, and they felt
it would be useful if you are not sure of the data path.  If you feel
sure of the data path, then you should delete and move on.

In any case, my response to the student:

> You say you are not solid on ALUK.  I think you are more solid than you
> give yourself credit for.  But, since you asked, I will add some verbiage:
> ALUK consists of 2 bits, therefore four operations.  ADD and AND require
> two operands.  The other two are NOT and PASS A.  I feel confident that
> you know that NOT requires just one operand.  PASS A does exactly what
> you said, it sends the A input to the ALU to the output, "unmolested."
> And, as you point out, we never specify control signals for SR2MUX.  That
> control signal is bit 5 of the instruction which determines whether the
> B source should be a register or an immediate.
> Good luck with the rest of the problem set and the exam.
> Yale Patt

His email to me was the following:

> > Hello Dr. Patt, my name is ****************  and I'm a student in your EE
> > 306 class. I have a few questions about the final question on the problem
> > set that I was hoping you could clear up for me.
> >
> > Firstly, I don't quite understand how the ALUK control signal works, so I
> > don't want to just make an assumption about it. From what I can gather, if
> > a state specifies "ALUK = ADD," then the output of SR1MUX and SR2MUX will
> > be added in the ALU. For example, in the ADD instruction, if we want to use
> > two source registers, SR1MUX will output the contents of SR1 (specified by
> > IR[8:6]), and then SR2MUX will output the contents of SR2 because the 5 bit
> > is set to 0. The two will then be added in the ALU because the ALUK will
> > say "ADD" and the result will be loaded onto the bus. Is all of that
> > correct?
> >
> > If, instead of ADD, we do, say, an ST, what would the ALUK say? The ST
> > instruction involves the contents of only one register. So, would the ALUK
> > say something that would tell the ALU, "let the contents of SR1 pass
> > through without altering them"?
> >
> > The reason I ask is because Problem 19 on the problem set says "ALUK = ADD"
> > in State 13, but it mentions nothing about a second operand (i.e. a second
> > source register or an immediate value); it only mentions SR1. This lack of
> > any mention of a second operand has caused some doubt among my study
> > partners and myself as to whether there should be a second operand at all.
> >
> > Looking at the data path however, my assumption is that it should not say
> > anything about a second operand because, unlike SR1MUX, SR2MUX appears to
> > be more influenced by the programmer and how he/she writes the instruction,
> > so I would assume that if ALUK is telling the ALU "ADD," then the contents
> > of the register specified by IR[8:6] would be added to either an immediate
> > value or the contents of a second register, whereas if we're not dealing
> > with a second operand, then the ALUK would just tell the ALU something
> > else. But I'm unsure as to whether I should proceed with this, mainly
> > because I am unfamiliar with how the ALUK works. But I think my assumption
> > makes sense since part b of the problem talks about two different formats
> > for specifying the operands, which makes sense if one format involves two
> > source registers while the other involves one source register and an
> > immediate value.
> >
> > Secondly, State 13 says "LD.MDR=1." I think this means that the output of
> > the ALU will be loaded into the MDR, since GateALU is also set to 1. I was
> > just confused because LD.MDR was written before everything else in this
> > bubble, but I'm assuming that this doesn't matter. Is this correct?
> >
> > I apologize if the answers to my questions seem obvious, but I'm worried
> > that if I just go with a mere assumption, it may turn out incorrect for
> > some reason that I had not considered and my understanding of the subject
> > matter would be hindered as a result.
> >
> > Thank you very much,
> >
> > <<name withheld to protect the student who understands more than he thinks>>