Documente Academic
Documente Profesional
Documente Cultură
CPE 352: Computer Architecture Second Exam – 2nd Semester 2013/2014 10/5/2014
Question 1:
Assume the following Code segment is to be executed by the MIPS pipelined
machine. The LW instruction enters the pipeline at cycle 1.
SW $3,4($31)
J 0xCC012
LW $3,0($31)
ADDI $1,$2,4
BEQ $3,$1,0xFFFC
At cycle all 5 instructions have entered the pipeline. During this cycle,
show the status of all control signals in the pipeline.
Question 2:
Consider the following program which represents a loop that will execute
100 times on a MIPS pipelined processor.
1: LOOP: LW $10,0($1)
2: ANDI $11,$10,0X01
3: LW $20,0($2)
4: BEQ $20,$0,EVEN //Pattern T,NT,T,NT,NT
5: ODD: ADD $20,$20,$10
6: BEQ $0,$20,FSH //always not taken
7: EVEN: SUB $20,$20,$10
8: ADDI $20,$20,4
9: FSH: ADDI $30,$30,-1
10: BNE $30,$0,LOOP //Taken 99 times and last one is not taken
5- How many cycles per iteration are consumed due to data hazards if
NO forwarding is used, and branches are correctly predicted?
6- How many cycles per iteration are consumed due to data hazards if
forwarding is used, and branches are correctly predicted?
Question 3:
Assume the following cache configuration, 32-bit physical address, direct
mapped 16MB cache size, 256 block size.
a. how many bits are required for the tag, the block index, and the
byte offset?
b. Identify the cache hit/miss for each of the following addresses.
(Assume startup conditions and the addresses appear in sequence.)
No. Address Hit/Miss
1 AA A01B 04 miss
2 AA B01B 08 Miss
3 AA A01B 0C Hit
4 BB B01B 18 Miss
5 AA C01B 60 Miss
6 BB A01B 04 Miss
7 AA B01B 08 miss
8 CC A01B 0C miss
9 AA A01B 18 miss
10 AA C01B 60 hit
11 CC A01B 90 miss
Question 4:
Assume a 2-level cache configuration with the following parameters
1st level cache is split into instruction cache and data cache
2nd level cache is unified for both instruction and data
1st level cache hit time= 1 cycle
Each 1st level cache is connected to the 2nd cache through a wide bus
of 128 lines with a bus cycle time of 5 processor cycles
The memory is composed of 4 banks connected to the 2nd cache via a
32-bit bus. The bank latency is 20 processor cycles and the bus cycle time
is 5 processor cycles.
1st instruction cache hit rate = 0.9
1st data cache hit rate = 0.8
2nd cache hit rate (when a miss occurs in 1st level) = 0.7