You are on page 1of 2

Name

: Nur Hanis Bt Mohamad Rafee


Matric No. : 1130437
Exercise 1

1) The different parameters that affect the performance of a computer are


viruses, the minimum of RAM, the processor speed and the minimum of
hard drive space.
2) The differences among direct mapping, associative mapping and setassociative mapping :
Direct Mapping
-

The RAM is made


use of to store
data and some is
stored in the
cache.
An address space
is split into two
parts index field
and tag field.
The cache is used
to store the tag
field whereas the
rest is stored in
the main memory.

Associative Mapping
-

The associative
memory is used to
store content and
addresses both of
the memory word.
Enables the
placement of the
any word at any
place in the cache
memory.
The fastest and
most flexible
mapping form.

Set-associative
Mapping
- The modified form
of the direct
mapping where
the disadvantage
of direct mapping
is removed.
- Set-associative
mapping allows
that each word
that is present in
the cache can
have two or more
words in the main
memory for the
same index
address.

3) For Direct Mapping :


Direct Mapping is the simplest technique . It maps each of the block of
main memory into only one possible cache line.
For Associative Mapping :
It overcomes the disadvantage of direct mapping by permitting each main
memory block to be loaded into any line of the cache. The cache control
logic interprets a memory address simply as a Tag and a Word field. To
determine whether a block is in the cache, the cache control logic must
simultaneously examine every lines Tag for a match.
For Set-associative Mapping :
A compromise that exhibits the strengths of both the direct and
associative approaches while reducing their disadvantages.
4) The different between spatial locality and temporal locality :
Spatial Locality

Temporal Locality

Name
: Nur Hanis Bt Mohamad Rafee
Matric No. : 1130437
The concept that likelihood of
referencing a resource is higher if a
resource near it was just referenced.

The concept that a resource that is


referenced at one point in time will be
referenced again sometime in the near
future.

5) The various replacement algorithm used in cache memory are Least


Recently Used (LRU), First-in-first-out (FIFO) and Least Frequently Used
(LFU).

LRU
The most effective
Replace that block
in the set that has
been in the cache
longest with no
reference to it
Because of its
simplicity of
implementation,
LRU is the most
popular
replacement
algorithm

FIFO
Replace that block
in the set that has
been in the cache
longest
Easily
implemented as a
round-robin or
circular buffer
technique

LFU
Replace that block
in the set that has
experienced the
fewest references
Could be
implemented by
associating a
counter with each
line

You might also like