111 Computer Organization - Quiz 2
111 Computer Organization - Quiz 2
X1 = ps
7. What is the execution time (X2) of an add instruction in a pipelined implementation? 2000 ps
X2 = ps
8. What is the total execution time (X3) in a pipelined implementation for the following three
instructions: lw, add, beq? 2800 ps
X3 = ps
1
( A ) 9. Referring to Figure 4.24, assume that data memory is all zeros and that the processor’s registers
have the following values at the beginning of the cycle in which the following instruction word is
fetched: lw $21, 24($20). Which of the following is wrong?
$0 $16 $17 $18 $19 $20 $21 $22 $23 $24
0 2 44 25 14 200 8 25 25 32
(A) The input value for “Write data” of the “Registers” unit is 8.
(B) The output value for “Read data 2” of the “Registers” unit is 8.
(C) The input values of the “ALU” unit is 200 and 24.
(D) The input value for “Read register 1” of the “Registers” unit is 20.
( C ) 10. Referring to Figure 4.24, assume that data memory is all zeros and that the processor’s registers
have the following values at the beginning of the cycle in which the following instruction word is
fetched: add $17, $18, $19. Which of the following is wrong?
$0 $16 $17 $18 $19 $20 $21 $22 $23 $24
0 2 44 25 14 200 8 25 25 32
(A) The input value for “Read register 2” of the “Registers” unit is 19.
(B) The output value for “Read data 1” of the “Registers” unit is 25.
(C) The input value for “Write data” of the “Data memory” unit is 14.
(D) The input value for “Write data” of the “Registers” unit is 39.
2
MIPS 5-satge Pipeline: Read and Write Operations on Registers and Memories
IF ID EX MEM WB
IF and Read data from rs Write data
R-format Operates the data
(PC+4) and rt into rd
IF and Read data from Write data
lw Read data from rs Base address + offset
(PC+4) memory into rt
IF and Read data from rs Write data into
sw Base address + offset
(PC+4) and rt memory
IF and Read data from rs (rs – rt) and
beq
(PC+4) and rt (PC+4)+(offset x 4)
Figure 4.24