logo

Crowdly

Browser

Додати до Chrome

CA & OS (Computer Architecture) - EFREI - Fall 2026

Шукаєте відповіді та рішення тестів для CA & OS (Computer Architecture) - EFREI - Fall 2026? Перегляньте нашу велику колекцію перевірених відповідей для CA & OS (Computer Architecture) - EFREI - Fall 2026 в moodle.lab.ii.agh.edu.pl.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Structural hazard - number of instructions

One of the indicators used to evaluate  the efficiency of the program execution is CPI (Clock cycles Per Instruction). It gives the information about average clock cycles required to execute one instruction. For the sequential processor that has a 5-stage execution unit and each stage requires one clock cycle, CPI value is 5. The lower the CPI value is better.

CPI value can be easily calculated taking the number of instructions that program contains and the number of clock cycles required to execute that program.

How many instructions program from previous question contain?

Переглянути це питання
CPI value for pipelined execution

What is CPI value for pipelined execution of the program ?

(This can be calculated manually or obtained from the statistics window of the WinMIPS64 simulator).

Переглянути це питання
Structural hazard

A structural hazard occurs when two or more instructions that are in different phases of the execution request access to the same hardware resource (memory, execution unit, etc.). In MIPS it can be easily observed when you are using the  floating point division unit. The program below can be used to illustrate that situation.

    .data

A:    .word 3

v:    .double

0.0

x:    .double 10.0

y:    .double

5.0

z:    .double 0.0

    

 

  .text

main:    l.d f2,x(r0)      ;f2=x

   

l.d f3,y(r0)      ;f3=y

    

    div.d

f5,f3,f2    ;f5=x/y

    div.d f6,f2,f3  

 ;f6=y/x

    add.d f8,f5,f6  

 ;f8=(x/y)+(y/x)

    

    add.d

f4,f3,f3

    mul.d f7,f13,f2

    mul.d

f13,f2,f4

    mul.d f9,f4,f13

 

  

    s.d f8,z(r0)

    s.d f9,v(r0)

Analyze that program and manually calculate how many clock cycles are needed to execute it on a sequential processor. 

Let assume that the execution of any instruction takes 5 clock cycles,

the execution of div.d instruction takes additional 23 clock cycles,

mul.d takes additional 6 clock cycles, add.d takes additional 3 clock cycles.

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

Переглянути це питання

Shortly explain why reordering instructions reduces the number of clock cycles required to execute a program?

Переглянути це питання
Limiting the impact of structural hazard

Sometimes it is possible to eliminate structural stalls by changing the order in which instructions are executed. Such modifications should be made with caution, paying attention to the correct results of the program execution. 

One of the possible changes in the example program is to move instruction add.d f4,f3,f3 and place it after the div.d f5,f3,f2 instruction.

Modify the program as suggested and execute it. 

How many clock cycles did it take to execute the modified program?

Переглянути це питання

Analyze the clock cycle diagram and find the instruction that causes a structural  stall (STR).

Place this instruction into answer box.

Переглянути це питання
Structural hazard - CPI calculation for sequential program execution

What is CPI value for sequential program execution?

Переглянути це питання
Number of structural stall cycles (STR)

Analyze clock cycle diagram an manually count number of structural stall (STR) cycles.

(it must be counted manually because structural stalls are not correctly counted in statistic window of WinMIPS64).

What is the number of structural stall cycles (STR)?

Переглянути це питання

Calculate or write down from statistic window CPI value.

Переглянути це питання

Shortly explain why the instruction given in the answer to the previous question causes structural hazard.

Переглянути це питання

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

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

Browser

Додати до Chrome