Looking for CA & OS (Computer Architecture) - EFREI - Fall 2026 test answers and solutions? Browse our comprehensive collection of verified answers for CA & OS (Computer Architecture) - EFREI - Fall 2026 at moodle.lab.ii.agh.edu.pl.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Insert another 9 dadd r1,r0,r1 instructions just after first dadd instruction of the sample program. After this you should have a total 10 dadd r1,r0,r1 instructions in your program. Execute modified program.
Write down into the box below the nMOD value which is the number of the clock cycles used for the execution of modified program. Be sure that forwarding mechanism is active (Configure->Enable forwarding option is active)
In this section, you will evaluate how long it takes to execute different types of the instructions of the MIPS computer.
Load and execute in step mode following program:
main: dadd r1,r0,r1 ; r1 = r0+r1 halt .text nop
As a result of the execution you should receive clock cycle diagram of the execution similar to this on the image:
Analyze this clock cycle diagram of execution of the program and answer the question: How many clock cycles does the execution of the instruction dadd r1,r0,r1 take (each box in clock cycle diagram represents one clock tick )?
A MIPS CPU executes the following code:
ld f,A(r0)ld f2,B(r0)nopdivd f3,f1,f2divd f4,f1,f2
In such a case the CPU may have to deal with:
Consider a processor in which the execution of each instruction is divided into 6 phases. What will be the theoretical maximum speedup of program execution if the processor's instructions can be executed in a pipeline?
Un processeur MIPS exécute le code suivant :
ld f,A(r0) ld f2,B(r0) nop divd f3,f1,f2 divd f4,f1,f2
In such a case the CPU may have to deal with:
Le programme utilisateur se compose de 25 instructions, chacune étant exécutée en 2 cycles d'horloge, et de 10 instructions, chacune étant exécutée en 5 cycles d'horloge.
Le nombre moyen de cycles par instruction ( CPI ) pour ce programme est :
Les aléas de contrôle sont principalement liés à l'exécution par le processeur d'instructions de saut (inconditionnelles ou conditionnelles). Pour observer le comportement du pipeline lors de l'exécution d'instructions de saut, le programme suivant sera utilisé :
;WinMIPS64 control hazard; just simple for loop in MIPS asm .datan: .word 3res: .word 0 .textmain: 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. beq r9, r0, end_loop ; branch if equal -> if (r9 == (r0=0)) go to 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_loopend_loop: sw r2,res(r0) syscall 0
Trouvez la partie du diagramme du cycle d'horloge qui illustre la première exécution de l' instruction beqz r9, end_loop . Analysez-la et répondez aux questions.
Quelle instruction est récupérée ensuite (entre dans la phase IF sur le diagramme du cycle d'horloge) ?
Quelle instruction est exécutée ensuite beq r9, r0, end_loop(entrée dans la phase EX sur le diagramme du cycle d'horloge) ?
Si l'exécution de l'instruction est suspendue (la réponse à la question précédente était VRAIE), comment la suspension peut-elle être expliquée ?
Ce type d'aléa peut survenir lorsque l'instruction suivante (j) stocke le résultat de son exécution dans la ressource (registre ou emplacement mémoire) utilisée comme argument par l'instruction précédente (i). Le problème apparaît lorsque l'exécution de l'instruction précédente (i) est retardée et que l'instruction suivante (j) se termine avant que l'instruction précédente (i) puisse recevoir son argument. Cela peut entraîner un résultat erroné pour l'instruction (i). La méthode classique pour supprimer cette dépendance consiste à retarder l'exécution de l'instruction (j) jusqu'à la fin de l'exécution de l'instruction (i). Pour illustrer ce problème, le code suivant sera utilisé :
;WinMIPS64 WAR hazard example .dataA: .double 10.0B: .double 5.0C: .double 3.5D: .double 1.0E: .double 3.14.0res: .double 0.0 .textmain: LDC1 f2,A(r0) LDC1 f3,B(r0) LDC1 f4,C(r0) LDC1 f5,D(r0) LDC1 f6,E(r0) add.d f2,f2,f3 sub.d f2,f2,f4 mul.d f4,f5,f6 SDC1 f2,res(r0) syscall 0
Activez le mécanisme de transfert de données et exécutez le programme d'exemple. Analysez le diagramme du cycle d'horloge et identifiez l'instruction provoquant le blocage WAR .
Marquez l'instruction qui provoque le blocage de WAR.