logo

Crowdly

Browser

Додати до Chrome

Control hazard Control hazards are mainly related to the processor's execution...

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

Control hazard

Control hazards are mainly related to the processor's execution of jump instructions (unconditional or conditional). To observe the behavior of the pipeline during the execution of jump instructions, the following program will be used:

;WinMIPS64 control hazard

; just simple for loop in MIPS asm

    .data

n:    .word 3

res:    .word 0

    

    .text

main:    

    xor r16,r16,r16    ; r16 = 0 loop counter

    xor r2,r2,r2    ; r2 = 0

    

    lw r17, n(r0) ; number of loop executions

    nop ; must be here to avoid RAW with next instr.

    

start_loop:    

    dsub r9, r16, r17 ; $t1= r9

    nop  ; must be here to avoid RAW with next instr.

    beqz r9, end_loop

    

    # code block

    daddi r2,r2,2

    dsub r2,r2,r0   ; r0 always contains 0

    daddi r16,r16,1 ; loop counter increment

    j start_loop

end_loop:    

    sw r2,res(r0)

    halt

Find the part of the clock cycle diagram that shows the first execution of the beqz r9, end_loop instruction. 

Analyze it and answer the questions.

Which instruction is fetched next (enters in the IF phase on clock cycle diagram) ?

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

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

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

Browser

Додати до Chrome