Examlex
Caching. "One of the keys to happiness is a bad memory." -Rita Mae Brown Consider the following piece of code:
int x = 0, y = 0; // The compiler puts x in r1 and y in r2. int i; // The compiler put i in r3.
int A[4096]; // A is in memory at address 0x10000
...
for (i=0;i<1024;i++) { x += A[i];
}
for (i=0;i<1024;i++) { y += A[i+2048];
}
(a) Assume that the system has a 8192-byte, direct-mapped data cache with 16-byte blocks. Assuming that the cache starts out empty, what is the series of data cache hits and misses for this snippet of code. Assume that ints are 32-bits.
(b) Assume that an iteration of a loop in which the load hits takes 10 cycles but that an iteration of a loop in which the load misses takes 100 cycles. What is the execution time of this snippet with the aforementioned cache?
(c) Repeat part A except assume that the cache is 2-way set associative with an LRU replacement policy and 16-byte sets (8-byte blocks).
(d) Repeat part B using the cache described in part C. Is the direct-mapped or the set-associative cache better?
Generic Brands
Products marketed without a branded name, often positioned as lower-cost alternatives to well-known brands.
High Ratings
A term used to indicate a positive evaluation or assessment, usually referring to quality, performance, or satisfaction in various contexts (e.g., product reviews, service evaluations).
Need for Closure
A psychological term describing an individual's desire for a clear and definite answer to a question or decision, to avoid ambiguity or uncertainty.
Internal Locus of Control
The belief that one controls their own destiny and outcomes are primarily the result of their own efforts and actions.
Q5: Analyze the following code: public class Test
Q8: Which term best describes the relationship between
Q8: Some machines have a special flag register
Q8: The east-west axis refers to:<br>A) Finding a
Q10: _ affects people's self-esteem.<br>A) Self-evaluation<br>B) Genetic inheritance<br>C)
Q12: Using 32-bit IEEE 754 single precision floating
Q13: Forwarding logic design. For this problem you
Q23: Name at least three of the most
Q39: Give another name for computer numerical control
Q61: The Lewis structure of the anion shown