Using the sample program results in Figure 5.33: a. How many levels of cache are there? b.
Question:
a. How many levels of cache are there?
b. What are the overall size and block size of the first-level cache?
c. What is the miss penalty of the first-level cache?
d. What is the associativity of the first-level cache?
e. What effects can you see when the size of the data used in the array is equal to the size of the second-level cache?
Figure 5.32 C program for evaluating memory systems.
Figure 5.33 Sample results from program in Figure 5.32.
Transcribed Image Text:
#include "stdatx.h" #1 nclude
#include "stdatx.h" #1 nclude #include #define ARRAY MIN (1024) /* 1/4 smallest cache * #define ARRAY-MAX (4096*4096)/* 1/4 largest cache */ int x[ARRAY MAX]; /* array going to stride through */ double get seconds/ routine to read time in seconds */ time64 t 1time time64<ime return (double) 1time; int label (int )/generate text labels if (icle3) printf("%18,",i); else if (le6) printf (1dK1/1024) else if le9) printf(1dM,i/1048576); else printf(1,",i/1073741824); return 0 int tmain int argc, TCHAR argv 0) int register nextstep, i, index, stride; int csize double steps, tsteps; double loadtime lastsec, seco, secl, sec; /* timing variables */ /Initialize output/ rintf(,"); or (stride, stride ARRAY MAX/2; stride=stride*2) label (stride sizeof int)); printf("n") * Main loop for each configuration * for (csize-ARRAY MIN; csizee ARRAY X csize-csize*2) [ label (csize sizeof (int); /* print cache size this loop / for (stride- stride csize/2; stride-stride*2) t /Lay out path of memory references in array * or index-0; index < csize index-index+stride x(index] = index + stride; /* pointer to next */ x[index-stride] 0; /* loop back to begning * Wait for timer to roll over/ astsec = get seconds(); do seco get seconds while (sec lastsec); /* Walk through path in array for twenty seconds / * This gives 5% accuracy with second resolution * steps 0.0; /number of steps taken */ nextstep 0 start at beginning of path seco get seconds 0 start timer* do /repeat until collect 20 seconds */ for (i-stride;i1-0-1-1) / keep samples same / nextstep0; do nextstepx [nextstep]: /* dependency while (nextstep 0); steps steps + 1.0; /* count loop iterations */ ec get seconds; / end timer/ ) while ((secI sec020.0) / collect 20 seconds / sec seci - sec0; Repeat empty loop to loop subtract overhead/ steps 0.0used to match no. while iterations/ dec ge eacont? same start iterations as ave do /*repeat until same no. iterations as above/ for (istride;il 0;--1) keep samples same/ index- 0 do indexindex stride while index< csize); tsteps = tsteps + 1.0; sec get seconds ); /* overhead/ } while (tsteps-steps); /* until no. iterations * sec sec (sec sec0 loadtime(sec e9)/(steps csize) / write out results in.csv format for Excel/ printf("%4.lf,", (loadtime<0.1) ? 0.1 : loadtime) ; / end of inner for loop */ printf ("\n); /* end of outer for loop */ return 0; 1000 BK 16K 女32K 64K 128K 256K 100 F 2M 8M 16M 士32M 64M 128M 256M →-512M 10 48 16B 64B 256 1K 4K 16K 64K 256K 1M 4M 16M E4M 256M Stride
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 45% (11 reviews)
a There are two levels of cache b The firstlevel cache is 32 KB and ha...View the full answer
Answered By
Carly Cimino
As a tutor, my focus is to help communicate and break down difficult concepts in a way that allows students greater accessibility and comprehension to their course material. I love helping others develop a sense of personal confidence and curiosity, and I'm looking forward to the chance to interact and work with you professionally and better your academic grades.
4.30+
12+ Reviews
21+ Question Solved
Related Book For
Computer Architecture A Quantitative Approach
ISBN: 978-0123704900
4th edition
Authors: John L. Hennessy, David A. Patterson
Question Posted:
Students also viewed these Computer Sciences questions
-
Assuming a page size of 4 Kbytes and that a page table entry takes 4 bytes, how many levels of page tables would be required to map a 64-bit address space, if the top-level page table fits into a...
-
Write a program that reads a connected graph from a file. The graph is stored in a file using the same format specified in Exercise. Your program should prompt the user to enter the name of the file,...
-
How many comparators are there in SORTER [n]?
-
What is a reporting entity?
-
Management of Thede Corporation has asked your help as an intern in preparing some key reports for July. The beginning balance in the raw materials inventory account was $28,600. During the month,...
-
An object of mass 2.0 kg is attached to the top of a vertical spring that is anchored to the floor. The uncompressed length of the spring is 8.0 cm, and the equilibrium position of the object on the...
-
State the (i) applications (ii) Advantages (iii) disadvantages of (a) Rope drive (b) Chain drive (c) Gear drive.
-
The demand for a new product is estimated to be normally distributed with = 200 and = 40. Let x be the number of units demanded and find the following probabilities: a. P(180 x 220) b. P(x 250)...
-
A block of mass =309 g is dragged with a string across a rough horizontal table. The string tension is =2.47 N, and it pulls upward at an angle of =46.0 with the horizontal. At one particular...
-
A company is able to implement one of two strategies regarding a particular product: hire a marketing firm to increase sales 20 percent or assign a product procurement manager who can reduce material...
-
With the adoption of virtualization support on the x86 architecture, virtual machines are actively evolving and becoming mainstream. Compare and contrast the Intel VT-x and AMD Secure Virtual Machine...
-
Modify the code in Figure 5.32 to measure the following system characteristics. Plot the experimental results with elapsed time on the y-axis and the memory stride on the x-axis. Use logarithmic...
-
In Example 8, by changing what one number in the first equation does the system become (a) Inconsistent? (b) Consistent? Data from Example 8 Solve the system of equations x 3y = 9 2x + 6y = 18. We...
-
Global airline alliances were created with the intention of growing the networks of airlines and providing greater access to more parts of the world. Recently, three major global alliances started to...
-
In which way are a carbon tax and an ETS equivalent policy instruments?
-
What tends to happen over time to the regulating agency in a regulated industry?
-
Why do legacy airlines have an advantage over LCCs in the international market?
-
How were LCCs in Europe affected by the EU Open Skies agreement?
-
Calculate the speed along the cylinder wall in Fig. 416, also confirming the answer to Prob. 3. Data from Prob. 3 Guess from physics and from Fig. 416 where on the y-axis the speed is maximum. Then...
-
A fuel pump sends gasoline from a car's fuel tank to the engine at a rate of 5.88 10-2 kg/s. The density of the gasoline is 735 kg/m3, and the radius of the fuel line is 3.18 10-3 m. What is the...
-
The Anton communication network is a 3D, 8 8 8 torus, where each node in the system has six links to neighboring nodes. Latency for a packet to transit single link is about 50 ns. Ignore on-chip...
-
The first Anton molecular dynamics supercomputer typically simulated a box of water that was 64 on a side. The computer itself might be approximated as a box with 1 m side length. A single...
-
Consider a case in which each of the eight cores on a Pixel Visual Core device is connected through a four-port switch to a 2D SRAM, forming a core+memory unit. The remaining two ports on the switch...
-
Suppose the pressure in the esophagus is - 1.95 mm Hg while that in the stomach is + 18.5 mm Hg. To what height, in centimeters, could stomach fluid rise in the esophagus, assuming it has a density...
-
When light of wavelength190nm falls on acesiumsurface, electrons having a maximum kinetic energy of 4.39eV are emitted. Find values for the following. (a) the work function of cesium eV? (b) the...
-
A soft tennis ball is dropped onto a hard floor from a height of 1.55 m and rebounds to a height of 1.12m. (Assume that the positive direction is upward.) (a) Calculate its velocity (in m/s) just...
Study smarter with the SolutionInn App