0% found this document useful (0 votes)
44 views5 pages

HW 1

The document discusses memory access methods and caching strategies. It defines sequential, direct, and random access and describes how memory address is divided into fields for direct-mapped, set-associative, and fully associative caches. It also defines spatial and temporal locality and strategies for exploiting them such as write-through, write-back, and copy-back caching.

Uploaded by

jayomaer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views5 pages

HW 1

The document discusses memory access methods and caching strategies. It defines sequential, direct, and random access and describes how memory address is divided into fields for direct-mapped, set-associative, and fully associative caches. It also defines spatial and temporal locality and strategies for exploiting them such as write-through, write-back, and copy-back caching.

Uploaded by

jayomaer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Mosab_2802

4.1 What are the differences among sequential access,


direct access, and random access?
Answer :
sequential access: is accessing data in a specific linear
sequence
direct access: the data address based on a physical location
random access: any location can be selected at random

4.2 What is the general relationship among access time,


memory cost, and capacity?
Answer:

There are the characteristics of a memory which are mainly constrained


by the technology used for its implementation.

4.3 How does the principle of locality relate to the use of


multiple memory levels?

Answer:
Mosab_2802

During execution of a program, memory references by the processor,


for both instructions and data, tend to cluster: once an area of the
program is entered, there are repeated references to a small set of
instructions and data

4.4 What are the differences among direct mapping,


associative mapping, and set-associative mapping?
Answer:

Direct mapping : A memory block is mapped into a unique cache line,


depending on the memory address of the respective block.

Set associative mapping: A memory block is mapped into any of the


lines of a set. The set is determined by the memory address, but the
line inside the set can be any one.

associative mapping: A memory block can be mapped to any cache


line. If a block has to be placed in the cache the particular line will be
determined according to a replacement algorithm

4.5 For a direct-mapped cache, a main memory address is


viewed as consisting of three fields. List and define the
three fields.
Answer:
Mosab_2802

2 bit: identify the byte within the block.

22 bits : identify the block in main memory

this part is interpreted as two fields:

14 bits : specify the cache line

8bits: represent the tag, which is stored in the cache together with the
line.

4.6 For an associative cache, a main memory address is


viewed as consisting of two fields.
List and define the two fields.
Answer:

2 bit : the byte within the block

22bits: is interpreted by the cache logic as a tag.

4.7 For a set-associative cache, a main memory address


is viewed as consisting of three fields. List and define the
three fields.
Answer:

13bits : are used to identify the set of lines in the cache

9 bits : represent the tag, which is stored in the cache together with the
line
Mosab_2802

2 bits : identify the bytes within the block

4.8 What is the distinction between spatial locality and


temporal locality?

Answer:

Temporal locality (locality in time): If an item is referenced, it will tend


to be referenced again soon.

Spacial locality (locality in space): If an item is referenced, items whose


addresses are close by will tend to be referenced soon.

4.9 In general, what are the strategies for exploiting spatial


locality and temporal locality?

Answer:
Write-through All write operations are passed to main memory; if the
addressed location is currently hold in the cache, the cache is updated
so that it is coherent with the main memory.

Write-through with buffered write The same as write-through, but


instead of slowing the processor down by writing directly to main
memory, the write address and data are stored in a high-speed write
Mosab_2802

buffer; the write buffer transfers data to main memory while the
processor continues it’s task.

Copy-back Write operations update only the cache memory which is


not kept coherent with main memory; cache lines have to remember if
they have been updated; if such a line is replaced from the cache, its
content has to be copied back to memory

You might also like