Home Page > > Details

COMP 3370 Computer Organization

 COMP 3370 Computer Organization April 8th, 2021

Contents
Instructions 1
Questions 2
Pipelining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Instructions
Due date: April 8th, 2021 at 11:59pm CDT (Winnipeg time) on UM Learn.
• All questions for this quiz are contained within this document.
– Any additional resources you need to answer questions are provided as both URLs (direct
to the source) and as a PDF on the course web page (in the same place you found this
document).
• You should write your answers in your own document (.docx, .pdf, .txt, .md, etc).
• Clearly indicate which questions you’re answering. Use numbered lists or headings in your doc￾ument. You may not be awarded points for a question if your answer for the question is not
clearly marked.
• You are explicitly permitted to refer to resources that are provided to you as part of this course
(slides, videos, etc).
• You are explicitly not permitted to share answers or discuss test questions with your class￾mates. Further, you are explicitly not permitted to post these questions on “homework help”
or “tutorial” websites.
• You must complete the honesty declaration checklist before you can see the submission folder
for this quiz.
• Submissions are only accepted on UM Learn. Submissions will not be accepted by e-mail.
• Late submissions will not be accepted, the submission deadline is enforced electronically.
• You may ask questions about the quiz and related content on Zoom during the scheduled class
meeting time or by e-mail. Your instructor will be available for questions during the scheduled
class time (8:30am – 9:45am). You may also ask questions by e-mail (8:30am – 3:30pm). E-mails
received after 3:30pm will not be answered until the next day. Pleasedo not ask questions about
the quiz on the course forum.
Franklin Bristow 1
COMP 3370 Computer Organization April 8th, 2021
Questions
Pipelining
1. The simulator that we’re working on in the assignments for this course explicitly does not have
control unit or functional unit pipelining.
Describe how you might add control unit pipelining support to this simulated CPU. You should
describe:
a. (1 point) How you would divide the instruction cycle phases into stages.
b. (2 points) The kinds of code-related changes you might make (behavioural code changes
and structural code changes).
c. (2 points) How you might handle hazards in the pipeline, referring specifically to the code
related changes you would make above.
You should choose to focus specifically on one type of hazard, and focus specifically on
one solution to minimizing stalls for that hazard (i.e., I’m not looking for you to compre￾hensively describe how your implementation would deal with all possible kinds of hazards,
just one).
I’m also explicitly not looking for you to describe how to identify that a hazard is present in
a sequence of instructions. You can assume that you have a function you can call, passing
it some instructions, and the function would return whether or not there is a hazard, and
where in the pipeline a hazard is present.
Franklin Bristow 2
COMP 3370 Computer Organization April 8th, 2021
2. (2 points) Here are two functionally equivalent code fragments in C:
Fragment 1:
for (int i = 0; i < 1000; i++)
a[i] = b[i] + c[i];
Fragment 2:
for (int i = 0; i < 1000; i+=4) {
a[i+0] = b[i+0] + c[i+0];
a[i+1] = b[i+1] + c[i+1];
a[i+2] = b[i+2] + c[i+2];
a[i+3] = b[i+3] + c[i+3];
}
Specifically in the context of pipelining (control unit or functional unit), which of these two code
fragments would you expect to run faster, and why?
You must explicitly state which fragment you would expect to run faster, explicitly state which
kind of pipelining you’re referring to, and explain why you believe that kind of pipelining would
make that code fragment run more quickly.
Franklin Bristow 3
COMP 3370 Computer Organization April 8th, 2021
3. Assume that you have a 6-stage pipeline, where each phase of the instruction cycle is a stage
in the pipeline (i.e., stages for instruction fetch, instruction decode, calculate offset, operand
fetch, execute instruction, and write-back). Hazards in this pipeline are handled by stalling.
You can assume that all instructions explicitly move through each stage, and that all operations
in the execute instruction stage take 1 cycle (i.e., ADD is 1 cycle, MUL is 1 cycle, …).
1: ADD R2,R3,R4 // R2+R3->R4
2: ADD R3,R5,R6
3: MUL R4,R7,R8
4: ADD R9,R2,R4
5: DIV R6,R8,R12
6: SUB R1,R10,R14
a. (2 points) What hazards are in this assembly language program? For each instruction that
contains a hazard, list the instruction, the type of hazard, and state why there is a hazard.
b. (2 points) Show how the sequence of instructions might be executed in the pipeline over
time. Note that when an instruction has to wait for a hazard, it should wait until the in￾struction causing the hazard has completed executing the write-back phase before it can
proceed.
Table 1: This table has been provided for you as a Word-formatted file, you can find it
alongside this quiz.
Time → 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
IF
ID
CO
OF
EX
WB
Franklin Bristow 4
COMP 3370 Computer Organization April 8th, 2021
4. (1 point, bonus) Go outside and take a picture. Include it in your submission.
NOTE: I’m making this text slightly longer so that you notice that there is indeed a question on
this page, and it’s not just a “this page is intentionally left blank” message.
Please look up! There’s a question 4!
Franklin Bristow 5
Contact Us - Email:99515681@qq.com    WeChat:codinghelp
Programming Assignment Help!