logo

Crowdly

R-A-W hazard R-A-W hazard is one of the most common problems related to the pi...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

R-A-W hazard

R-A-W hazard is one of the most common problems related to the pipelined and parallel instruction execution by the processor. This type of hazard occurs when the later instruction (j) requires  the results of the previous instruction (i) to be executed, but the execution of the earlier instruction (i) has not finished yet (the completion of the execution – the end of the WB phase of the instruction cycle in MIPS). If the program execution is not interfered with, it may happen that the later instruction (j) will perform operations on an incorrect argument - the correct value of the argument  for the instruction (j) is not available before the execution of the earlier instruction (i) is completed. The occurrence of this type of disturbance can be observed during the execution of the example program:

;MIPS64 RAW hazard example

    .data

A:    .word 2

B:    .word 3

C:    .word 7

D:    .word 0

    

    .text

main:    ld r1,A(r0)

    ld r2,B(r0)

    dadd r3,r1,r2

    sw r3,C(r0)

    lw r4,C(r0)

    dadd r5,r1,r4

    sw r5,D(r0)

    syscall 0

Analyze that program and calculate how many clock cycles are needed to execute it on the sequential processor. Let’s assume that the execution of any instruction takes 5 clock cycles.

How many clock cycles are needed to execute this program on a sequential processor?

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.lab.ii.agh.edu.pl?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome