You are on page 1of 3

Laboratory Exercise 12

Cache Memory
Name: Nguyễn Thị Linh
Student ID: 20200349

Assignment 1:

Assignment 2:
- A full 32-bit address in cache memory is used in some principles:
o The least significant bits of the address are used to specify the byte within the
block.
o The next set of bits are used to specify the block number within the cache.
o The remaining bits, known as the tag, are used to identify the main memory
location of the block.
- When there is a cache miss, the processor must access the main memory to retrieve the
requested the data
- When there is a cache hit, the processor can access the requested data from the cache,
which is much faster than accessing data from main memory
- The block size is 4 words ~ 16 bytes
- The tag is used to identify the main memory location of the block stored in the cache
Assignment 3:
- Answer the question:
o Cache size: total size of the cache (128 bytes)
o Block size: size of each cache line (4 words = 16 bytes)
o Set size: size of each set (apply for set associative placement policies) (1 block –
no set split)
o Write policy: the policy to determine which memory block should be placed in
the cache (Direct, fully associative, N-way Set Associative)
o Replacement policy: the policy to determine which cache line should be replaced
when the cache is full (LRU, random)
- The miss rate will decrease when executing a loop in multiple times
o Loop 1: Cache miss count = 7
o Loop 2: Cache miss count still equals 7 (There is no more miss in loop 2)

➔ Therefore, it will be better if cache memory is large enough to store all code in one
loop. If this loop is executed in multiple times, it will save much time, however in
case of the loop is executed once, there is no difference.
- The code containing many loops executed multiple times would benefit greatly from a
large block.

You might also like