Docsity

Computer Architecture Exam Questions - Fall 2002, Exams of Computer Architecture and Organization

Toggle sidebar
bg1
Comprehensive Examination
Computer Architecture
Fall 2002
2. (25%) Consider the hyper-pipelined processor, with a 30-stage, in-order, scalar pipeline.
Instructions are fetched in the 3rd stage, executed (including branches) in the 22nd stage, and
the LI cache is accessed in the 25th stage.
(a) What is the steady-state CPI of the following loop, assuming the loop is taken many
times, perfect branch prediction, and full forwarding support.
Loop: LW R5, IQO(R2)
SUB R I , R3, R5
ADDI R7, R5, #12
LW R8, 0(R7)
ADDI R9. R9, #1
ADDI R2, R2, #8
BNEZ R2, loop:
(b) What is the steady-state CPI assuming a 2-wide superscalar processor.
(c) What is the steady-state CPI assuming a scalar processor, but a 95% prediction accuracy
for the branch.
3. (20%) Consider the following code:
for (i=O;i<N;i++) {
if (A[i] > 1) {
…
}
if (A[i] <= 1 && B[i] > 1) {
…
}
}
Assume that A[] and B[] contain floating point numbers randomly distributed between 0
and 2. Also, assume that N is very large. What is the overall branch predict rate for this
loop? Consider all three branches (the two "if" branches, and the loop-back branch).
(a) Assume a completely local predictor (a predictor that is purely based on the PC of the
branch).
(b) Assume a global (correlating) predictor that uses a reasonably large global history register
as part of the index to the PHT.
pf2

Partial preview of the text

Download Computer Architecture Exam Questions - Fall 2002 and more Exams Computer Architecture and Organization in PDF only on Docsity!

Comprehensive Examination

Computer Architecture

Fall 2002

  1. (25%) Consider the hyper-pipelined processor, with a 30-stage, in-order, scalar pipeline. Instructions are fetched in the 3rd stage, executed (including branches) in the 22nd stage, and the LI cache is accessed in the 25th stage.

(a) What is the steady-state CPI of the following loop, assuming the loop is taken many times, perfect branch prediction, and full forwarding support.

Loop: LW R5, IQO(R2) SUB R I , R3, R ADDI R7, R5, # LW R8, 0(R7) ADDI R9. R9, # ADDI R2, R2, # BNEZ R2, loop:

(b) What is the steady-state CPI assuming a 2-wide superscalar processor.

(c) What is the steady-state CPI assuming a scalar processor, but a 95% prediction accuracy for the branch.

  1. (20%) Consider the following code:

for (i=O;i<N;i++) { if (A[i] > 1) { … } if (A[i] <= 1 && B[i] > 1) { … } }

Assume that A[] and B[] contain floating point numbers randomly distributed between 0 and 2. Also, assume that N is very large. What is the overall branch predict rate for this loop? Consider all three branches (the two "if" branches, and the loop-back branch).

(a) Assume a completely local predictor (a predictor that is purely based on the PC of the branch).

(b) Assume a global (correlating) predictor that uses a reasonably large global history register as part of the index to the PHT.

  1. (25%) A two-input switching function is expressed as

f(a,b) = (a+b)(a’+b’)(a+b’).

(a) Derive the minimum form of f (a, b) in switching expression.

(b) Suppose we connect the output of the function f to the input of one D FlipFlop, and connect the output of the D Flip-Flop, g , to signal b , we have a sequential machine with inputs a and output g. Write the state table of the sequential machine.

(c) Implement the sequential machine with one T Flip-Flop and a minimum ANDOR-NOT network.

4. (30%) Assume you have a 64 byte cache, with 16 bytes per block. The memory is byte addressable. All cache blocks start out as invalid. For (A) through (C) below, assume that the cache is direct mapped. Answer the following questions using the following address stream:

Addresses: 80, 111, 60, 45, 112, 10, 60, 1 1 , 94, 112, 35, 70, 15, 80, 112, 120, 60, 90

The address "80" is at position l, the address- “111" is at position 2, etc.

(a) How many cache hits are due to temporal reuse, and which address references are they (give the position and the address in the reference stream)?

(b) How many cache hits are clue to spatial reuse, and which address references are they (give the position and the address in the reference stream)’?

(c) How many cold start (compulsory) misses are there, and give their position and address in the reference stream’?

Addresses: 80, 111, 60, 45, 112, 10, 60, 11, 94, 112, 35, 70, 15, 80, 112, 120, 60, 90

(d) Now assume that the cache is fully associative with LRU replacement policy. Which addresses (give the address and the position in the reference stream) are cache hits? Label the hits as either spatial or temporal.