Question

Instructions The answers to questions below must be written in the file named you MUST replace which has been provided with this test. Important: login the FSUl of the filename with you actual FSU login ID. That file has lines that begin with Question N. where N corresponds to the question number. Below or beside each Question N. there are placeholder as described must be replaced with the correct answer in the specific formats, below question Questions 1 and 2: find out all hazards that exist in the two separate code segments, one for each question. Within the answers file, and under each question write the hazards you have detected for that segment by replacing the x and Y with line numbers from the code segment, and Twith the type of solution to the hazard. T can be M, W or S, where M forward from Memory stage, W forward from Writeback stage, and s stall. that a hazard may need to be solved by a combination of stall and forwarding, in which case both have to be listed individually, For example, if you think there is a hazard between lines 1 and 4 of the code segment in question 1, which can be solved by stalling the pipeline and also forwarding from the Memory stage, you would write the following in the answers Question 1. For more hazards detected for that segment, simply create more lines under that segment in the answers file and follow this format. Question 1 add and $s1 $s2 St2 $s5, $s1 or $s 1. $s6 Question 2. 40 ($0) $s0, $s1 and stl, $s4, $12, $50, $s5 sub Questions 3 4: are based on the pipelined MIPS processor, which is running the following program and has a hazard detection unit-also note that the program may need stalls for correct execution. For each question the answer must be a comma- separated list of register names. For example if the answer to question 3 is registers St0 and St1, then the answer for that question must be written by replacing X on a single line Question stl ere is only one register for the answer, just write only the specific register name in
media%2F281%2F281d584a-07f6-4cac-b327-2c
Computer science organization and architecture! Help!
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

Note: multiple questions, please post separately

Question 1:

  • There is clear data hazard between 1-2, 1-3 and 1-4 of the code segment.
  • The data is written into the register s1 in line 1 but it is used by both line 2, 3 and 4.
  • Thus there is occurs a data hazard.
  • Formally the above detected hazards can be represented as given below.
  • 1 2 S
  • 1 2 W
  • For instructions 1 and 2, they are consecutive instructions, so the data forward should be from write back stage.
  • 1 3 S
  • 1 3 M
  • For 1 and 3 instructions, the data will be in memory, so the memory forwarding is enough to handle the hazards here.
  • 1 4 S
  • 1 4 M
  • For 1 and 4th instruction also the data forwarding from memory stage is enough to handle the hazards.

Question 2:

  • In this case the same set of hazards occurs.
  • The data loaded into register s0 will be used in the instructions 2, 3 and 4.
  • There should be stall to execute the first instruction, the data forwarding will occurs.
  • The same set of forwarding and stall will follows in this case also.
  • Thus the forwarding sequences will be;
  • 1 2 S
  • 1 2 W
  • 1 3 S
  • 1 3 M
  • 1 4 S
  • 1 4 M

Question 3:

Answer: $t4

Explanation:

  • For the pipelined execution of instructions, the instruction execution stages will be divided into stages and continuous execution will takes place.
  • That means in first 5 cycles of the pipeline the first instruction will be completed its execution and the second instruction might complete 4 steps also.
  • For the given question the registers being written are first one surely register t4.
  • Since data forwarding is used to avoid data hazards, the register t0 in the second instruction needs the value of t4.

Question 4:

Answer: $t4, $s0

Explanation:

  • As given above the date written at t4 can be readily read by second instruction due to data forwarding.
  • Surely register s0 also.
Add a comment
Know the answer?
Add Answer to:
Computer science organization and architecture! Help! Instructions The answers to questions below must be written in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given the following sequence of instructions: lw $s2, 0($s1) //1 lw $s1, 40($s3) //2 sub $s3,...

    Given the following sequence of instructions: lw $s2, 0($s1) //1 lw $s1, 40($s3) //2 sub $s3, $s1, $s2 //3 add $s3, $s2, $s2 //4 or $s4, $s3, $zero //5 sw $s3, 50($s1) //6 a. List the read after write (current instruction is reading certain registers which haven’t been written back yet) data dependencies. As an example , 3 on 1 ($s2) shows instruction 3 has data dependency on instruction 1 since it is reading register $s2. b. Assume the 5...

  • home / study / engineering / computer science / computer science questions and answers / Write...

    home / study / engineering / computer science / computer science questions and answers / Write A Second Game Program That Prints A Chart To The Screen Showing The Randomness Of A Die. ... Question: Write a second game program that prints a chart to the screen showing the randomness of a die. Th... Write a second game program that prints a chart to the screen showing the randomness of a die. The game should first prompt the client for...

  • Please help me with these questions. thanks! Question 1: Identify the lines in the code segment...

    Please help me with these questions. thanks! Question 1: Identify the lines in the code segment below that contain syntax errors. You may assume all necessary libraries have been included. Evaluate each statement as if all previous statements are correct                 ofstream venom.open(“symbiote.txt”, ios::app); ifstream carnage;                 carnage.open(“symbiote2.txt:; ios::in | ios::out)                 venom.seekp(-10L, ios::beg); cout << carnage.tellg(0); venom << “HI. I’m Eddie Brock> Can Peter come out and play?” << endl; Answers:                 Connecting the output stream to the file...

  • QUESTION 6 Please match questions (definitions) with answers - A computer designed to be used by...

    QUESTION 6 Please match questions (definitions) with answers - A computer designed to be used by one person at a time, commonly connected to a LAN and run multi-user operating systems - Main residential program that coordinates all hardware and software activity and provide interface for User (GUI). A collection of information stored as one unit with one name. 1. Algorithm 2. File 3. Operating System 4. End User workstation - Sequence of connected instructions that describes behavior of any...

  • Answer all questions. Number your answer as the question is numbered below. Answers must be in...

    Answer all questions. Number your answer as the question is numbered below. Answers must be in essay form. Outline form is NOT acceptable. Labeled diagrams may be used to supplement discussion, but in no case will a diagram alone suffice. It is important that you read each question completely before you begin to write. .. 4. Select two of the following three pairs and discuss the evolutionary relationships between the two members of each pair you have chosen. In your...

  • see below: You will be creating a personal quiz that will provide a grade depending on the responses given. The quiz should contain at least three questions of the true/false or multiple-choice natu...

    see below: You will be creating a personal quiz that will provide a grade depending on the responses given. The quiz should contain at least three questions of the true/false or multiple-choice nature. You should select only one type of question to use. These questions should originate from Comprehension Check in your textbook (noting the chapter and page number) These questions and the correct answer identifier should be stored in a text file. A second table should contain the possible...

  • NOTE PLEASE ALL ANSWERS MUST BE IN EXCEL FORMULA. X 5 ? X . HOME Calculating...

    NOTE PLEASE ALL ANSWERS MUST BE IN EXCEL FORMULA. X 5 ? X . HOME Calculating yield to maturity - Excel FORMULAS DATA REVIEW - Sign In FILE INSERT PAGE LAYOUT VIEW Paste B I U- - - A Alignment Number 8.12 oints Conditional Format as Cell Formatting Table Styles Styles Cells - Clipboard Font Skipped D17 А в E F G H I к eBook Print A Japanese company has a bond outstanding that sells for 91.53 percent of...

  • All answers must be entererd as formulas CHAPTER 8 0 Seved Help Save & Exit Submit...

    All answers must be entererd as formulas CHAPTER 8 0 Seved Help Save & Exit Submit Consider the following two mutually exclusive projects. What is the IRR for each project? What is the crossover rate between the two projects? What is the NPV for each project at the various interest rates in cells C27 to C32? Annual cash flows: Year 0 Year 1 Year 2 Year 3 $ (24,000) 10,620 10,900 10,500 (24,000) 12,100 9,360 10,400 Complete the following analysis....

  • In this lab, we’ll investigate the 802.11 wireless network protocol. Follow the instructions and answers questions...

    In this lab, we’ll investigate the 802.11 wireless network protocol. Follow the instructions and answers questions 7 - 10. http://gaia.cs.umass.edu/wireshark-labs/wireshark-traces.zip In this lab, we'll investigate the 802.11 wireless network protocol. Before beginning this lab, you might want to re-read Section 6.3 in the text. Since we l1 be delving a bit deeper into 802.11 than is covered in the text, you might want to check out "A Technical Tutorial on the 802.11Protocol," by Pablo Brenner (Breezecom Communications) http://www.sss-mag.com/pdf802_11tut.pdf, and "Understanding...

  • java In this project you will implement a trivia game. It will ask random trivia questions, evaluate their answers and keep score. The project will also have an administrative module that will allow f...

    java In this project you will implement a trivia game. It will ask random trivia questions, evaluate their answers and keep score. The project will also have an administrative module that will allow for managing the question bank. Question bank management will include adding new questions, deleting questions and displaying all of the questions, answers and point values. 2. The project can be a GUI or a menu based command line program. 3. Project details 1. Create a class to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT