retagged by
2,383 views
1 votes
1 votes
a) Pipeline contains 5 stages: IF, ID, EX, M and W;
b) Each stage requires one clock cycle;
c) All memory references hit in cache;
d) Following program segment should be processed:
// ADD TWO INTEGER ARRAYS

LW R4  # 400
L1: LW R1, 0 (R4)  ; Load first operand
LW R2, 400 (R4)  ; Load second operand
ADDI R3, R1, R2  ; Add operands
SW R3, 0 (R4)  ; Store result
SUB R4, R4, #4  ; Calculate address of next element
BNEZ R4, L1  ; Loop if (R4) != 0

Calculate how many clock cycles will take execution of this segment on the regular (non pipelined) architecture ?
retagged by

1 Answer

Best answer
2 votes
2 votes
Each instruction have 5 stages and each stage requires 1 clock cycle

So clock cycles required for 1 instruction = 5

Now the loop is running for 100 times since we are decrementing by 4 each time

There are 6 instructions in the loop.

Non pipeline means we have to execute sequentially

So total time require for execution = 1 * 5 + 6 * 5 * 100 = 5+3000 = 3005 clock cycles
selected by

Related questions

12 votes
12 votes
1 answer
2
PEKKA asked Oct 27, 2016
14,818 views
Collition Vector : 1011010 MAL for the above Collition Vector is _____Please also tell me how to calculate efficiency and throughtput