3055q5a - Score Name ECE 3055 Quiz V Wednesday October 2...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Score: Name: ECE 3055 Quiz V, Wednesday, October 2 The program below is executed on the 5 stage pipelined MIPS described in chapter 6. Answer the following questions about this program. loop: lw 84,100(80) lw 83,300(84) lw 87,200(80) slt 88,87,83 beq 88,84,then and 86,87,88 addi 85,85,6 then: or 88,85,88 sw 85,100(86) beq 85,80,loop Assume the control unit does not have any hazard detection, forwarding, a new branch compare circuit, or automatic branch flushing, and that the register file will not write and then read a new register value in one clock cycle. Rewrite the code sequence by adding the minimum number of NOP instructions (do not reorder or change instructions) to eliminate all potential data and branch hazards. Assume other non-NOP instructions follow the last branch in the original code sequence above. Total number of NOPs r uired I Z 4 + F +5 . lw if? . ~\ QOkCl" (\OP 0?? : hop m: n... Mg, \w is? W mafia “a 5 1+ 3:»; no ° . V1 , ~ 6 Assume the control unit is improved by adding the hazard and forwarding unit as outlined in the text and the current lab i' D V‘ \‘ assignment, adding a branch compare unit to the decode stage, and the register file writes then reads a new value in a (1‘ Q $ ‘ “3 single clock cycle. Determine the number of clock cycles required to complete the first loop execution (i.e. executes l , . code in loop and branches back to top of loop and is just ready to fetch sw again) of the original code sequence. -' 1 Assume the inner branch is not taken. ( Assume the processor starts this “(5ng initially at power up. if there were no hazards or branch flushing, the original program would require 1 El: clock cycles for execution. (include the time to initially fill the pipeline). +3P‘i's. But this program will need to stall and/or flushs the pipeline an additional 3 clock cycles so 6 3 Fig ’ a total of I I clock cycles is required for execution ( include the time to initially fill the pipeline). ’l Com/k L oak cycle, 03-...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern