Professional Documents
Culture Documents
ELEC6036 Ass1 20 21 Sol PDF
ELEC6036 Ass1 20 21 Sol PDF
Due Date: October 20, 2020 (kindly submit your assignment via the “Assignment 1 –
Submission” link of our online course Moodle system in the HKU portal) – at or before 23:55
Questions:
(a) Consider the following instruction sequence (RAW hazard through memory):
Does this require forwarding hardware for maximum performance? If yes, draw/describe
the forwarding hardware and describe the control circuitry. If no, explain why not.
(10 marks)
ANSWER:
No. (4 marks)
Both of these operations occur in the memory stage. Thus, the value is stored out
on one cycle and grabbed on the next cycle. This is a forward motion of information
that happens automatically through the memory system.
sw F D E M W
lw F D E M W
(4 ~ 5.5 marks for any reasonable explanation; or 6 marks for a very complete
explanation as above)
(b) Consider the following instruction sequence (RAW hazard through registers):
lw $9, 20($6)
sw $9, 30($7)
Does this require forwarding hardware for maximum performance? If yes, draw/describe
the forwarding hardware and describe the control circuitry. If no, explain why not.
(10 marks)
ELEC 6036 HIGH PERFORMANCE COMPUTER ARCHITECTURE
(The Sugg. Sol. of Assignment 1 – 2020/21 )
ANSWER:
Yes. (4 marks)
(3~3.5 marks for any reasonable explanation; or 4 marks for a very complete
explanation as above)
The forwarding logic consists of a MUX (see the following diagram) that connects
the output of the memory to the store value for the next instruction. The control
logic is simple. In the execute stage of a store instruction, check to see if:
♦ the instruction in the memory stage is a load
♦ the destination register for that load matches the source register for the store
in the execute stage
If these two conditions are met, flip the MUX to latch the value from the memory
rather than from register rt (normal mode).
(2 marks for general discussion of MUX as above OR the complete diagram as below)
-END of Assignment 1-