Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Set Associative Mapping-Advance Computer Architecture-Lecture Slides, Slides of Advanced Computer Architecture

This course focuses on quantitative principle of computer design, instruction set architectures, datapath and control, memory hierarchy design, main memory, cache, hard drives, multiprocessor architectures, storage and I/O systems, computer clusters. This lecture includes: Set, Associative, Address, Block, Number, Mapping, Cache, Memory, Bytes, Bits, Main, Sets, Lines

Typology: Slides

2011/2012

Uploaded on 08/06/2012

amrusha
amrusha 🇮🇳

4.4

(32)

149 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Set Associative Mapping
Summary
Address length = (s + w) bits
Number of addressable units = 2s+w words or bytes
Block size = line size = 2w words or bytes
Number of blocks in main memory = 2d
Number of lines in set = k
Number of sets = v = 2d
Number of lines in cache = kv = k * 2d
Size of tag = (s d) bits
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Set Associative Mapping-Advance Computer Architecture-Lecture Slides and more Slides Advanced Computer Architecture in PDF only on Docsity!

Set Associative Mapping

Summary

Address length = (s + w) bits Number of addressable units = 2s+w^ words or bytes Block size = line size = 2w^ words or bytes Number of blocks in main memory = 2d Number of lines in set = k Number of sets = v = 2d Number of lines in cache = kv = k * 2d Size of tag = (s – d) bits

Set Associative Mapping

Cache is divided into a number of sets

Each set contains a number of lines

A given block maps to any line in a given set

  • e.g. Block B can be in any line of set i

e.g. 2 lines per set

  • 2 way associative mapping
  • A given block can be in one of 2 lines in only one set

Set Associative Mapping Address Structure

Use set field to determine cache set to look in

Compare tag field to see if we have a hit

e.g

  • Address Tag Data Set number
  • 1FF 7FFC 1FF 12345678 1FFF
  • 001 7FFC 001 11223344 1FFF

Tag 9 bit (^) Set 13 bit Word2 bit

Two Way Set Associative

Mapping Example

Working of Two-way Set Associative Cache

Let us see how it works? ─ the cache index selects a set from the cache. The two tags in the set are compared in parallel with the upper bits of the memory address.

─ If neither tag matches the incoming address tag, we have a cache miss

─ Otherwise, we have a cache hit and we will select the data on the side where the tag matches occur.

This is simple enough. What is its disadvantages?

Disadvantage of Set Associative Cache

First of all, a N-way set associative cache will need N comparators instead of just one comparator (use the right side of the diagram for direct mapped cache).

A N-way set associative cache will also be slower than a direct mapped cache because of this extra multiplexer delay.

Finally, for a N-way set associative cache, the data will be available AFTER the hit/miss signal becomes valid because the hit/miss is needed to control the data MUX.

Disadvantage of Set Associative Cache

If it assumes that it is a hit; it will be ahead

by 90% of the time as cache hit rate is in the

upper 90% range, and for other 10% of the

time that it is wrong, just make sure that it

can recover

We cannot play this speculation game with a

N-way set - associative cache because as we

said earlier, the data will not be available to

until the hit/miss signal is valid.

Allah Hafiz

And

Aslam-U-Alacum