Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question 1. Cache Mapping and Access

Consider a 1 MB cache with 16-word cachelines. Each word is 4-Bytes. This cache uses write-back scheme, and the address is 32 bits wide.

A. Direct-Mapped Cache Fields

Assume the cache is direct-mapped. Fill in the table below to specify the size of each address field of the cache.

Field                      Size (bits)

Cacheline             Offset

Cacheline             Index

Tag

B. Fully-Associative Cache Fields

Assume the cache is fully-associative. Fill in the table below to specify the size of each address field of the cache.

Field                      Size (bits)

Cacheline             Offset

Cacheline             Index

Tag

C. 16-Way Set-Associative Cache Fields

Assume the cache is 16-way set-associative. Fill in the table below to specify the size of each address field.

Field                      Size (bits)

Cacheline             Offset

Cacheline             Index

Tag

Question 2. Average Memory Access Time

Assume the following processor configuration: a dedicated L1 cache for instructions (IL1) and a L1 cache for data (DL1), a shared L2 cache that serves as an intermediate level between each of the L1 caches and the main memory. The figure below shows the hierarchy:

396_memory.jpg

Figure 1: Cache Hierarchy

Processor Spec Computer A
Cycle Time 1ns
Hit Time to L1(I-L1 or D-L1) and return the data to the processor 1 cycle
1L1 miss rate 8%
DL1 miss rate 15%
Hit Time to L2 and return the data to the L1(I-L1  or D-L1) 6 cycles
L2 miss rate 30%
Main Memory Access Time from L2 50 cycles

Figure 2: Table containing the processor cache Specifications

Out of the total instructions executed in this processor, assume load/store instructions comprise of 25% of the total instructions. Answer the following questions.

A. Calculate AMAT

What is the average memory access time?

B. Processor with no caches

Assume CPI = 1 if the processor has no memory stalls. Without the caches, each memory access would take 52 cycles. What is the CPI of the processor without any caches?

C. Processor with two levels of caches (as in Figure 1)

Assume CPI = 1 if the processor has no memory stalls. What is the CPI of processor with the all the caches? Remember that it takes 50 cycles to access memory from L2.

Question 3. Two-Cycle Instruction Cache

In this problem, we will be examining the performance of the instruction cache on the MIPS assembly program shown on the next page. The first column shows the instruction address for each instruction. Note that these addresses are byte addresses. The value of r1 is initially 64, meaning that there are 64 iterations in the loop. In this problem, we will be considering the execution of this loop with a direct-mapped instruction cache microarchitecture with eight cache lines, and each cacheline is 16B. This means each cache line can hold four instructions and the bottom four bits of an instruction address are the block offset. Hint: The first instruction in the code segment (i.e., addiu r1, r1, -1), is in the middle of a cache line with starting address 0x100.

For this problem, the instruction cache hit time is two cycles, but it is fully pipelined. Tag check occurs in the first cycle, and if it is a hit, the instruction is read in the second cycle. Essentially, this creates a six-stage pipelined processor with the following stages: instruction cache tag check (F0), instruction cache data access (F1), decode (D), execute (X), memory (M), and write-back (W). This also implies the data cache hit time is one cycle.

Assume that jumps are resolved in the decode stage and that branches are re- solved in the execute stage. Assume the miss penalty is three cycles so on a cache miss the pipeline will stay in F0 for a total of three cycles, go into F1 for one cycle, and then continue as normal. You should assume that in every other way, the processor pipeline follows the classic fully-bypassed five-stage pipeline. Assume that the processor does not include a branch delay slot. Assume the processor speculatively predicts all jumps and branches are not taken.

A. Control Hazards

Draw a pipeline diagram illustrating the first iteration of the loop assuming there are no instruction cache misses. Remember that there are two fetch stages (F0 and F1). Show stalls by simply repeating the pipeline stage character (e.g., D) for multiple consecutive cycles.

Use a dash (-) to indicate pipeline bubbles caused by killing instructions (pipeline flushes). You should show all instructions in the first iteration of the loop and the first instruction of the second iteration that you can properly draw the control dependency for the backwards branch.

 

Address

 

Instruction

Q3.B Iteration 1

ICache Miss Type

Q3.C Iteration 2

ICache Miss Type

 

loop:

 

 

0x108

addiu r1, r1,  -1

 

 

0x10c

j foo

 

 

0x110

addiu r2, r2,  1

 

 

0x114

addiu r3, r3,  1

 

 

0x118

addiu r4, r4,  1

 

 

0x11c

addiu r5, r5,  1

 

 

 

...

 

 

 

foo:

 

 

0x218

bgtz r1, loop

 

 

0x21c

addiu r6, r6,  1

 

 

0x220

addiu r7, r7,  1

 

 

0x224

addiu r8, r8,  1

 

 

0x228

addiu r9, r9,  1

 

 

B. First Iteration of the Loop

Fill in the table above. In the appropriate column, write compulsory, conflict, or capacity next to each instruction which misses in the instruction cache to indicate the type of instruction cache misses that occur in the first iteration of the loop. Assume that the instruction cache is initially completely empty. Now draw a pipeline diagram illustrating the first iteration of the loop including instruction cache misses. Clearly indicate the number of cycles it takes to execute the first iteration.

C. Second Iteration of the Loop and overall CPI

Continue to fill in the table above. Write compulsory, conflict, or capacity next to each instruction which misses in the instruction cache to indicate the type of instruction caches misses that occur in the second iteration of the loop. Now draw a pipeline diagram illustrating the second iteration of the loop. Clearly indicate the number of cycles it takes to execute the second iteration. Calculate the CPI for this processor executing all 64 iteration of the loop (Note: The CPI calculation should not include instructions that are fetched but then later squashed).

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91721949

Have any Question?


Related Questions in Computer Engineering

The following data is the results of a random sample of the

The following data is the results of a random sample of the ages (in years) of 12 houses in a community: 18, 22, 23, 19, 18, 24, 26, 20, 17, 12, 27, 28. Assume the population is normal. Construct a 90% confidence interva ...

With respect to bus request interruptswhat must be allowed

With respect to bus request interrupts: What must be allowed to complete before the interrupts is serviced? What resources (CPU, buses, memory, etc..) is the ISR expected to use? What is the ISR typically expected to do? ...

You are given a test to enter graduate school you must

You are given a test to enter graduate school. You must select 10 of the 13 essay questions to answer to determine your writing skills. How many ways can you select those questions?

Question suppose you have a ray of light that hits a flat

Question : Suppose you have a ray of light that hits a flat surface such as a mirror and is reflected. What is the direction of reflection? This is a problem that arises in areas such as optics and computer graphics. To ...

On the spot courier services grew and changed over the

On the Spot courier services grew and changed over the years. At first, Bill received requests for package pickups on his mobile phone, recorded that information in a log, and would then drive around to retrieve all the ...

Answer the following question where does the responsibility

Answer the following Question : Where does the responsibility of the software developer reside in considering the discrimination in techonology based on gender race and disability? How do you think it affects you as a pr ...

What is the broadcast domain and ports for hubs and

What is the Broadcast Domain and Ports for hubs and bridges?

Can anyone please describe how the quicksort works

Can anyone please describe how the quicksort works including a discussion of the pivot. Also how it is selected, and why the pivot is important to the quicksort.

Sorting program note make sure you use c programming

Sorting Program Note: Make sure you use c++ programming otherwise i will not grade your work For this assignment, you are to write a comparative algorithm that will compare the efficiency of three sorting routines. Here ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Provide examples and state precisely the meaning of the following features supported by ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As