Tue, 27 September 2016, 00:14



A student writes:


> Hi Dr. Patt. On question 5 of problem set 2, we are asked to create the
> logic table for the logic block in the memory system that is drawn out for
> us. One of the outputs is a 4 bit input into the MDR register. I thought
> this signal would be the bits that indicate which bytes of the MDR to load
> where each bit corresponds to a byte, however after going over the notes on
> physical memory, I realized that none of my outputs handled sign extension.
> Should I be able to handle sign extension with the 4 bit input into the MDR
> or would sign extension be a separate output that (at least on this
> particular problem) is not included?
>
> <<name withheld to protect the student who can't find sign-extension>>


You are correct, the 4 bits input into the MDR coming from the logic are
load enable signals to the four bytes of the MDR.

With respect to sign-extension, we can do it between memory and the MDR,
or between the MDR and the Register that is being loaded.  In Problem 5,
I chose to not deal with sign-extension between memory and the MDR, which
means I will have to do it between the MDR and the regiser that will be
loaded.

What is important here is that if we are doing a LDByte, the result of the
memory access is to load MDR[7:0] with the relevant byte and if we are doing
LDHalfWord, the result of the memory access is to load MDR[15:0] with the
relevant two bytes.  It does not matter what we do about the other bytes of
the MDR, since we will do sign-extension from the MDR to the register being
loaded.

Good luck with the problem set.


Yale Patt