0% found this document useful (0 votes)
47 views229 pages

COA Unit 4 (Complete)

The document discusses memory organization and architecture, focusing on cache mapping techniques such as direct-mapping, associative mapping, and set-associative mapping. It includes numerical problems related to cache memory calculations and differences between mapping techniques, highlighting their advantages and disadvantages. Additionally, it provides previous years' questions from AKTU related to these topics.

Uploaded by

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

COA Unit 4 (Complete)

The document discusses memory organization and architecture, focusing on cache mapping techniques such as direct-mapping, associative mapping, and set-associative mapping. It includes numerical problems related to cache memory calculations and differences between mapping techniques, highlighting their advantages and disadvantages. Additionally, it provides previous years' questions from AKTU related to these topics.

Uploaded by

kingragnar114
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COMPUTER ORGANIZATION AND ARCHITECTURE (BCS302)

UNIT-4 MEMORY
Today’s Target Lec-6(part2)

 Set associative mapping


 Numerical
By PRAGYA RAJVANSHI
 AKTU PYQS’
[Link], [Link]( C.S.E)
NUMERICALS
at is Stack Organization?
MEMO CACHE BLOCK NO OF BIT IN TAG NO OF SET SET
RY SIZE SIZE SIZE TAG DIRECTORY ASSOCIATIVE
(IN BITS
128KB 16KB 256B 2 WAY

32GB 32KB 1KB 4WAY

512KB 1KB 7 8 WAY

16GB 4KB 10 4WAY

64MB 10 4WAY

512KB 7 4 WAY
DIFFERENCE BETWEEN-
at is Stack Organization?

Direct-mapping Associative Mapping Set-Associative Mapping

Main Memory Address is divided Main Memory Address is divided Main Memory Address is divided
into 3 fields : TAG, BLOCK & WORD. into 1 fields : TAG & WORD. into 3 fields : TAG, SET & WORD.
The BLOCK & WORD together make
an index. The least significant WORD
bits identify a unique word within a
block of main memory, the BLOCK
bits specify one of the blocks and the
Tag bits are the most significant bits.
DIFFERENCE BETWEEN-
at is Stack Organization?

Direct-mapping Associative Mapping Set-Associative Mapping

Needs comparison with all tag


Needs only one comparison bits, i.e., the cache control logic Needs comparisons equal to
because of using direct formula must examine every block’s tag number of blocks per set as the
to get the effective cache for a match at the same time in set can contain more than 1
address. order to determine that a block blocks.
is in the cache/not.
DIFFERENCE BETWEEN-
at is Stack Organization?

Direct-mapping Associative Mapping Set-Associative Mapping

There is one possible location in


The mapping of the main The mapping of the main
the cache organization for each
memory block can be done with memory block can be done with
block from main memory
any of the cache block. a particular cache block
because we have a fixed formula.

If the processor need to access If the processor need to access


In case of frequently accessing
same memory location from 2 same memory location from 2
two different pages of the main
different main memory pages different main memory pages
memory if reduced, the cache hit
frequently, cache hit ratio frequently, cache hit ratio has no
ratio reduces.
decreases. effect.
DIFFERENCE BETWEEN-
at is Stack Organization?

Direct-mapping Associative Mapping Set-Associative Mapping

Search time is less here because Search time is more as the cache
there is one possible location in the control logic examines every block’s Search time increases with number
cache organization for each block tag for a match. of blocks per set.
from main memory.

The index is given by the number of The index is zero for associative
The index is given by the number of
blocks in cache mapping.
sets in cache.
DIFFERENCE BETWEEN-
at is Stack Organization?

Direct-mapping Associative Mapping Set-Associative Mapping

It has less tags bits than associative


It has the greatest number of tag
It has least number of tag bits. mapping and more tag bits than
bits.
direct mapping.
DIFFERENCE BETWEEN-
at is Stack Organization?

Direct-mapping Associative Mapping Set-Associative Mapping

Advantages- Advantages- Advantages-


•Simplest type of mapping •It is fast. •It gives better performance than
•Fast as only tag field matching is •Easy to implement the direct and associative mapping
required while searching for a word. techniques.
•It is comparatively less expensive
than associative mapping.
DIFFERENCE BETWEEN-
at is Stack Organization?

Direct-mapping Associative Mapping Set-Associative Mapping

Disadvantages- Disadvantages- Disadvantages-


•It gives low performance because of •Expensive because it needs to store •It is most expensive as with the
the replacement for data-tag value. address along with the data. increase in set size cost also
increases.
AKTU QUESTION
at is Stack Organization?
Discuss different mapping technique used in cache memory and their merits and AKTU 2018-19
Q1
demerits AKTU 2019-20

AKTU 2022-23
AKTU2021-22
Q2 numerical AKTU 2019-20
AKTU 2018-19
AKTU 2016-17
COMPUTER ORGANIZATION AND ARCHITECTURE (BCS302)

UNIT-4 MEMORY
Today’s Target Lec-7

 Set associative mapping


 Numerical
By PRAGYA RAJVANSHI
 AKTU PYQS’
[Link], [Link]( C.S.E)
NUMERICALS
at is Stack Organization?
Problem-01:
Consider a 2-way set associative mapped cache of size 64 KB with block size 256 bytes. The size of main
memory is 512 KB. Find-
 Number of bits in tag
 Tag directory size
NUMERICALS
at is Stack Organization?
Q2 Consider a 8-way set associative mapped cache of size 1024 KB with block size 1 KB. There are 7 bits
in the tag. Find-
 Size of main memory
 Tag directory size
NUMERICALS
at is Stack Organization?
Q3 Consider a 4-way set associative mapped cache with block size 8 KB. The size of main memory is 32
GB and there are 12 bits in the tag. Find-
Size of cache memory
Tag directory size
NUMERICALS
at is Stack Organization?
Q4Consider a 8-way set associative mapped cache. The size of cache memory is 256 KB and there are 13
bits in the tag. Find the size of main memory.
NUMERICALS
at is Stack Organization?
Q5 Consider a 8-way set associative mapped cache. The size of main memory is 128 MB and there are 10
bits in the tag. Find the size of cache memory..
AKTU QUESTION
at is Stack Organization?
Discuss different mapping technique used in cache memory and their merits and AKTU 2018-19
Q1
demerits AKTU 2019-20

AKTU 2022-23
AKTU2021-22
Q2 numerical AKTU 2019-20
AKTU 2018-19
AKTU 2016-17
AKTU Full Courses (Paid)
Download Gateway Classes Application
From Google Play store
All Subjects

Link in Description
COMPUTER ORGANIZATION AND ARCHITECTURE (BCS302)

UNIT-4 MEMORY
Today’s Target Lec-8

 CACHE MAPPPING
 AKTU PYQS’
By PRAGYA RAJVANSHI
[Link], [Link]( C.S.E)
NUMERICAL 1
at is Stack Organization?
Q1Consider a cache consisting of 256 blocks of 16 words each of total of 4096 words and assume that the
main memory is addressable by a 16 bit address and it consists of 4k blocks . How many bits are there in
each of tag , set and word field for 2 way associative technique(AKTU 2022-23)
NUMERICAL 2
at is Stack Organization?
A Digital computer has a memory unit of 64kx16 and cache memory of 1k words .The cache use direct
mapping with a block size of 4 words(AKTUI 2021-22)
1. how many bits are in the tag, index , block and I word filed of the address format
2. how many bits are there in each word in cache and how they are individual into function include a valid
function
3. how many blocks can the cache accommodate.
NUMERICAL 3
at is Stack Organization?
 a two way set associative cache memory uses block of 4 words .The cache can accommodate a total of
2048 words from memory .the main memory size is 128k x32
1 Formulate the all pertinent information required to construct the cache memory
2What is the size of cache memory (AKTU 2018-19)
NUMERICAL 4
at is Stack Organization?
 A computer uses a memory unit with 256k words of 32bit .A binary instructions code is stored in one
words of memory the instructions has 4 parts an indirect bit an operation code, a register code part to
specify one of 64 register and an address part ( AKTU 2018-19)
1. How many bits are there in the operation code, the register code and address part
[Link] the instruction format and indicate the number of bits in each part
[Link] many bits are there in the data and address input of the memory
NUMERICAL 5
at is Stack Organization?
consider a cache uses a direct mapping scheme .The size of the main memory is 4Kbyte and word size of
cache is 2 byte. The size of cache memory is128 byte .find the following: (AKTU 2014-15)
[Link] size of the main memory address(assume each byte of main memory has an address)
2address of cache block
3 how many memory location address will be translated to cache address block /location
4 how can it be determined if the content of specified main memory address in cache?
NUMERICAL 6
at is Stack Organization?
Q1 a computer has 256kbytes. 4 way set associative write back cache with the block size of 32 bytes. The
processor sends 32bit address to the cache controller. Each cache tag directory entry contains in addition to
address tag 2 valid bits in the tag field of an address explain each step calculations (AKTU 2021-22)
AKTU Full Courses (Paid)
Download Gateway Classes Application
From Google Play store
All Subjects

Link in Description

You might also like