ECE3055 Fall'99 Homework Assignment #1



Due before 3:00 p.m. Tuesday 2/8/00

Instructions.  Copy this document from the Web Page, or save it from
your email program, as a "text" file.  Edit it in a word processor to
add the answers into the square brackets after each question.  Save it
as a "text" file, and email it back to me:
(john.copeland@ece.gatech.edu).

Email the completed document as the body of a message (not as an
attached document) with the Subject exactly as "HW-1" (no quotes). 
Please send questions or comments in a separate message, with a
different Subject (e.g., "Question on HW-1").

I will not accept paper returns. If you can not complete the
assignment on time, tell me why and turn it in as soon as possible for
partial credit. Remember, home work grades count as 10% of the final
grade.

Your return will be graded by a computer program that looks for your
answers between square brackets.  Please do not add or delete square
brackets (or the ***???*** flags).  The format and units of answers
should be those indicated in the problem (e.g., a letter, a group of
letters, or a number).  Each question counts equally. Each answer
within a question counts equally, but the value depends on the number
of answers within the question.

See
Tips on Submitting HW for more information.

--------- (You may delete all above this line) ------------------
***START_HW*** (do not delete preceding flag, or the ]-XXXX flags
below).

[     ]-NAME   Enter your name (form: last, first middle initial)

[     ]-PRISM  Enter your Prism account code (form: "gtXNNNA" where
"N"
is a number, "A" is a letter, and X is either. Do not include
"@prism.gatech.edu").

[     ]-EMAIL  Enter the email address ("account@server") where you
would like to receive your graded homework.  If on the Prism account
above, leave blank.

#1.  Consider the following instructions for a pipelined MIPS
processor with no data-forwarding or hazard-detection circuits:

  add   $s0, $t0, $t1
  sub   $t2, $s0, $t3
  
[  ]   How many NOP's would have to be added between the two
instructions to prevent an error due the data dependency (or hazard)?

#2.  Consider the following instructions for a pipelined MIPS
processor with no data-forwarding or hazard-detection circuits:

  add   $s0, $t0, $t1
  add   $s1, $t0, $t2
  sub   $t2, $s0, $t3
  
[  ]   How many NOP's would have to be added between the first and
last instructions to prevent an error due the data dependency (or
hazard)?

[   ] Could the hazard be resolved by a different assembler technique
that would not slow down the program (Y for "yes", N for "no")?

#3.  Consider the following instructions for a pipelined MIPS
processor:

  lw   $t0, 4($t1)
  sw   $t0, 4($t2)
  
[  ]  How many NOP's would have to be added between the two
instructions to prevent an error due the data dependency (or hazard)
if the CPU did not have a data forwarding unit?

[  ]  How many NOP's would have to be added between the two
instructions to prevent an error due the data dependency (or hazard) 
if the CPU did have a data forwarding unit?

#4.  Match up the following answers with the questions below.

A. Control hazard
B. Structural hazard
C. Data dependency
D. A stall or bubble
E. Dynamic branch prediction
F. Forwarding

[  ]  Immediate use of data from a load word instruction.
[  ]  Predicting a branch direction based on previous directions.
[  ]  Immediate use of a register value that was just written.
[  ]  Feeding back the output from the ALU to one of the ALU inputs.
[  ]  Halting the IF and EX stages while letting other stages execute.
[  ]  A branch instruction whose direction was not predicted.

#5.  What will the operating system do:

  A. Save the state of the process so it can be restarted later.
  B. Halt execution and send an error message to the user.

in a pipelined machine when the following events occur:

[  ]  An ALU overflow.
[  ]  An I/O interrupt.
[  ]  An illegal instruction.
[  ]  An illegal memory address.
[  ]  An operating system service call.

#6.  In what stage do the following appear in the MIPS architecture?

Answers: IF, ID, EX, MEM, WB

[   ]  Forwarding Unit
[   ]  Hazard detection unit
[   ]  Data memory
[   ]  Program memory
[   ]  (CPU) Control
[   ]  Register writing from memory or ALU result
[   ]  Register writing of immediate data
[   ]  ALU
[   ]  Branch direction unit (=)

(v 1.0, web)
#####