SlideShare a Scribd company logo
1 of 12
Download to read offline
EC6020 – ARSITEKTUR KOMPUTER LANJUT
TUGAS – 4
CHAPTER 5
BUS, CACHE AND SHARED MEMORY
SOAL-SOAL TENTANG ORGANISASI-ORGANISASI CACHE MEMORY
(CACHE MEMORY ORGANIZATIONS)
ARWIN
NIM. 232 06 008
MAGISTER TEKNIK ELEKTRO
SEKOLAH TINGGI ELEKTRONIKA DAN INFORMATIKA
INSTITUT TEKNOLOGI BANDUNG
2006
Arwin – 23206008@2006
1
Problem 5.8 – The main memory of a computer is organized as 64 blocks with a block size of eight
(8) words. The cache has eight (8) block frames. In parts (a) through (d), show the mapping from the
numbered blocks in main memory to the block frames in the cache. Draw all lines showing the
mappings as clearly as possible.
a. Show the direct mapping and the address bits that identify the tag field, the block
number, and the word number.
b. Show the fully associative mapping and the address bits that identify the tag field and the
word number.
c. Show the two-way set-associativity mapping and the address bits that identify the tag
field, the set number, and the word number.
d. Show the sector mapping with four blocks per sector and the address bits that identify
the sector number, the block number, and the word number
Answer :
From the above statement, we get the memory and cache configuration information to calculate the
identification bits and the addressing scheme. They are :
Main memory has 64 blocks → 64 6n s= ↔ = because 2s
n =
Cache memory has 8 block frames 8 3m r→ = ↔ = because 2r
m =
Block size is 8 words 8 3b w→ = ↔ = because 2w
b =
a. Direct mapping cache
Tag field = 6 3 3s r− = − = bit
Block field = 3r = bit
Word field = 3w = bit
Arwin – 23206008@2006
2
The addressing and mapping scheme are as followed :
Arwin – 23206008@2006
3
b. 8-way Fully associativity cache
Tag field = 6s = bit
Word field = 3w = bit
The addressing and mapping scheme are as followed :
Arwin – 23206008@2006
4
c. 2-way Set associativity cache
Set = 4 2v d= ↔ = because 2d
v =
Tag field = 6 2 4s d− = − = bit
Set field = 2d =
Word field = 3w = bit
For 2-way associativity cache implementation, there will be 4 sets where each set consists of 2
block frames (subsets) and each subset will cover 2 main memory blocks. The 4-bit tag
determines which 2 main memory’s blocks have right access to a particular set at a time (see
the table below).
Set Number
(2 bits)
Block Frame
Number
Memory Block Number
(2-way associativity)
0 (00) 0 1B dan B 0, 16 and 32, 48
1 (01) 2 3B dan B 1, 17 and 33, 49
2 (10) 4 5B dan B 2, 18 and 34, 50
3 (11) 6 7B dan B 3, 19 and 35, 51
0 (00) 0 1B dan B 4, 20 and 36, 52
1 (01) 2 3B dan B 5, 21 and 37, 53
2 (10) 4 5B dan B 6, 22 and 38, 54
3 (11) 6 7B dan B 7, 23 and 39, 55
0 (00) 0 1B dan B 8, 24 and 40, 56
1 (01) 2 3B dan B 9, 25 and 41, 57
2 (10) 4 5B dan B 10, 26 and 42, 58
3 (11) 6 7B dan B 11, 27 and 43, 59
0 (00) 0 1B dan B 12, 28 and 44, 60
1 (01) 2 3B dan B 13, 29 and 45, 61
2 (10) 4 5B dan B 14, 30 and 46, 62
3 (11) 6 7B dan B 15, 31 and 47, 63
Arwin – 23206008@2006
5
The addressing and mapping scheme are as followed :
Arwin – 23206008@2006
6
d. 4-block Sector cache
64 memory’s blocks are divided into 16 sectors which each sector contains 4 blocks.
8 cache’s block frames are divided into 2 sectors which each sector contains 4 block
frames.
Block field = 4 bits to cover 16 sectors of the main memory.
Tag field = 3 bits which is divided into 2 functions, selection bit and sector bit.
Sector Number
(1 bit)
Block Frame
Number
Sector Number
MemoryBlock
Number
0 0 3B dan B
1 4 7B dan B
0,1,.......,15 0 1 63, ,...........,B B B
0 0 3B dan B
1 4 7B dan B
0,1,.......,15 0 1 63, ,...........,B B B
The addressing and mapping scheme are as followed :
Arwin – 23206008@2006
7
This 4-block sector mapping scheme allows each memory’s sector placed in any of the
available cache’s block frames in fully associative mode.
Arwin – 23206008@2006
8
Problem 5.9 – Consider a cache ( )1M and memory ( )2M hierarchy with the following
characteristics :
1 :M 16 Kwords, 50 ns access time.
2 :M 1 Mwords, 400 ns access time.
Assume eight-word cache blocks and a set size of 256 words with set-associative mapping.
a. Show the mapping between 2M and 1M .
b. Calculate the effective memory access time with a cache hit ratio of 0.95h = .
Answers :
a. Mapping between 2M and 1M . From the above statement we collect some
information such that :
1 block = 8 word 3
2 3b w→ = ↔ = .
16 Kwords cache 14
2m m= ↔ = words = 14 3 11
2 2−
= block frames or
2,048 block frames starting from 0 2,047B B− . So that 11r = bits.
1 Mwords memory 20
2n n= ↔ = words = 20 3 17
2 2−
= memory blocks or
131,072 blocks starting from 0 131,071B B− . So that 17s = bits.
Set size, 8
256 2k = = words or 8 3 5
2 2k −
= = blocks. There will be 32-way
associativity. Then, number of sets,
11
6
5
2
2
2
m
v
k
= = = or 64 sets starting from
0 63S S− . Hence, each set will consist of 32 block frames. The bit set number,
2log 6d v= = bits.
Word field = 3 bits.
Set field = 6 bits to cover 64 sets of the cache memory.
Tag field = 17 6 11s d− = − = bits.
Arwin – 23206008@2006
9
Mapping Table
Set Number
(6 bits)
Block Frame Number Memory Block Number
(32-way associativity)
0 (000000) 0 1 32, ,.......,B B B
0, 64, 128, ……, 131008
1 (000001) 33 34 63, ,.......,B B B 1, 65, 129, ……, 131009
2 (000010) 64 65 95, ,.......,B B B 2, 66, 130, ……, 131010
3 (000011) 96 65 127, ,.......,B B B 3, 67, 131, ……, 131011
………….. …………. ……………….
36 (100100) 1152 65 1183, ,.......,B B B 36, 100, 167, ……, 131047
………….. …………. ……………….
63 (111111) 2016 65 2047, ,.......,B B B 63, 127, 191, ……, 131071
Arwin – 23206008@2006
10
The mapping scheme is as followed :
Arwin – 23206008@2006
11
b. The effective memory-access time can be derived as followed :
The general formula for effective memory-access time is :
1
.
n
eff i i
i
T f t
=
= ∑ where n is th
n -memory hierarchy.
Because ( )( ) ( )1 2 11 1 ........ 1i i if h h h h−= − − − , the above formula can be rewritten as
( ) ( ) ( )1 1 1 2 2 1 2 2 11 ............ 1 ....... 1eff n nT h t h h t h h t h t−= + − + + − −
What we’ve got are :
Cache ( )1M access time, 1 50t = ns
Memory ( )2M access time, 2 400t = ns
Cache hit ratio, 1 0.95h = and the access to the outermost memory, 2M , is always
hit or 2 1h =
So, the effective memory-access time is :
( )
( )( ) ( )( )( )
1 1 1 2 21
0.95 50 1 0.95 1 400
47.5 20
67.5
effT h t h h t
ns
= + −
= + −
= +
=

More Related Content

What's hot

Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipeliningMazin Alwaaly
 
8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
 
Cache performance considerations
Cache performance considerationsCache performance considerations
Cache performance considerationsSlideshare
 
Advanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem SolutionsAdvanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem SolutionsJoe Christensen
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generationIffat Anjum
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitabdosaidgkv
 
Computer organisation -morris mano
Computer organisation  -morris manoComputer organisation  -morris mano
Computer organisation -morris manovishnu murthy
 
Superscalar and VLIW architectures
Superscalar and VLIW architecturesSuperscalar and VLIW architectures
Superscalar and VLIW architecturesAmit Kumar Rathi
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms Paresh Parmar
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organizationanishgoel
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture pptParvesh Gautam
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Byte and string manipulation 8086
Byte and string manipulation 8086Byte and string manipulation 8086
Byte and string manipulation 8086mpsrekha83
 

What's hot (20)

Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
8086 instructions
8086 instructions8086 instructions
8086 instructions
 
Cache performance considerations
Cache performance considerationsCache performance considerations
Cache performance considerations
 
Advanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem SolutionsAdvanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem Solutions
 
Homework solutionsch8
Homework solutionsch8Homework solutionsch8
Homework solutionsch8
 
8086
80868086
8086
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generation
 
Cache memory
Cache memoryCache memory
Cache memory
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Computer organisation -morris mano
Computer organisation  -morris manoComputer organisation  -morris mano
Computer organisation -morris mano
 
08 Operating System Support
08  Operating  System  Support08  Operating  System  Support
08 Operating System Support
 
Superscalar and VLIW architectures
Superscalar and VLIW architecturesSuperscalar and VLIW architectures
Superscalar and VLIW architectures
 
Disk scheduling algorithms
Disk scheduling algorithms Disk scheduling algorithms
Disk scheduling algorithms
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
Computer Organization
Computer OrganizationComputer Organization
Computer Organization
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture ppt
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
Byte and string manipulation 8086
Byte and string manipulation 8086Byte and string manipulation 8086
Byte and string manipulation 8086
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 

Similar to EC6020 – ARSITEKTUR KOMPUTER LANJUT TUGAS – 4 CHAPTER 5 BUS, CACHE AND SHARED MEMORY

Memory caching
Memory cachingMemory caching
Memory cachingFraboni Ec
 
Memory caching
Memory cachingMemory caching
Memory cachingJames Wong
 
Cmp.pptx
Cmp.pptxCmp.pptx
Cmp.pptxfoff3
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxabcxyz19691969
 
Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...TELKOMNIKA JOURNAL
 
Chapter 8 1 Digital Design and Computer Architecture, 2n.docx
Chapter 8 1 Digital Design and Computer Architecture, 2n.docxChapter 8 1 Digital Design and Computer Architecture, 2n.docx
Chapter 8 1 Digital Design and Computer Architecture, 2n.docxchristinemaritza
 
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...Dr. Loganathan R
 

Similar to EC6020 – ARSITEKTUR KOMPUTER LANJUT TUGAS – 4 CHAPTER 5 BUS, CACHE AND SHARED MEMORY (20)

Memory caching
Memory cachingMemory caching
Memory caching
 
Memory caching
Memory cachingMemory caching
Memory caching
 
Memory caching
Memory cachingMemory caching
Memory caching
 
Memory caching
Memory cachingMemory caching
Memory caching
 
Memory caching
Memory cachingMemory caching
Memory caching
 
Memory caching
Memory cachingMemory caching
Memory caching
 
Cmp.pptx
Cmp.pptxCmp.pptx
Cmp.pptx
 
2. Cache Mapping.pptx
2. Cache Mapping.pptx2. Cache Mapping.pptx
2. Cache Mapping.pptx
 
Cache memory
Cache  memoryCache  memory
Cache memory
 
OS
OSOS
OS
 
SHA512.pptx
SHA512.pptxSHA512.pptx
SHA512.pptx
 
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptxwaserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
waserdtfgfiuerhiuerwehfiuerghzsdfghyguhijdrtyunit5.pptx
 
Cache memory
Cache memoryCache memory
Cache memory
 
2013-June: 3rd Semester E & C Question Papers
2013-June: 3rd Semester E & C Question Papers2013-June: 3rd Semester E & C Question Papers
2013-June: 3rd Semester E & C Question Papers
 
3rd Semester Electronic and Communication Engineering (2013-June) Question P...
3rd  Semester Electronic and Communication Engineering (2013-June) Question P...3rd  Semester Electronic and Communication Engineering (2013-June) Question P...
3rd Semester Electronic and Communication Engineering (2013-June) Question P...
 
Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...Decoding of the extended Golay code by the simplified successive-cancellation...
Decoding of the extended Golay code by the simplified successive-cancellation...
 
Chapter 8 1 Digital Design and Computer Architecture, 2n.docx
Chapter 8 1 Digital Design and Computer Architecture, 2n.docxChapter 8 1 Digital Design and Computer Architecture, 2n.docx
Chapter 8 1 Digital Design and Computer Architecture, 2n.docx
 
Coa
Coa Coa
Coa
 
12 memory hierarchy
12 memory hierarchy12 memory hierarchy
12 memory hierarchy
 
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...
 

More from Joe Christensen (20)

Live a life_that_matters
Live a life_that_mattersLive a life_that_matters
Live a life_that_matters
 
Advanced Computer Architecture Chapter 123 Problems Solution
Advanced Computer Architecture Chapter 123 Problems SolutionAdvanced Computer Architecture Chapter 123 Problems Solution
Advanced Computer Architecture Chapter 123 Problems Solution
 
Two Choices
Two ChoicesTwo Choices
Two Choices
 
IEEE 12207
IEEE 12207IEEE 12207
IEEE 12207
 
Lecture 13
Lecture 13Lecture 13
Lecture 13
 
Lecture 15
Lecture 15Lecture 15
Lecture 15
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 8 9
Lecture 8 9Lecture 8 9
Lecture 8 9
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 7n
Lecture 7nLecture 7n
Lecture 7n
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Lecture 14
Lecture 14Lecture 14
Lecture 14
 
Moble Communication
Moble CommunicationMoble Communication
Moble Communication
 
Ch20
Ch20Ch20
Ch20
 
Ch18
Ch18Ch18
Ch18
 
Ch19
Ch19Ch19
Ch19
 
Ch17
Ch17Ch17
Ch17
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

EC6020 – ARSITEKTUR KOMPUTER LANJUT TUGAS – 4 CHAPTER 5 BUS, CACHE AND SHARED MEMORY

  • 1. EC6020 – ARSITEKTUR KOMPUTER LANJUT TUGAS – 4 CHAPTER 5 BUS, CACHE AND SHARED MEMORY SOAL-SOAL TENTANG ORGANISASI-ORGANISASI CACHE MEMORY (CACHE MEMORY ORGANIZATIONS) ARWIN NIM. 232 06 008 MAGISTER TEKNIK ELEKTRO SEKOLAH TINGGI ELEKTRONIKA DAN INFORMATIKA INSTITUT TEKNOLOGI BANDUNG 2006
  • 2. Arwin – 23206008@2006 1 Problem 5.8 – The main memory of a computer is organized as 64 blocks with a block size of eight (8) words. The cache has eight (8) block frames. In parts (a) through (d), show the mapping from the numbered blocks in main memory to the block frames in the cache. Draw all lines showing the mappings as clearly as possible. a. Show the direct mapping and the address bits that identify the tag field, the block number, and the word number. b. Show the fully associative mapping and the address bits that identify the tag field and the word number. c. Show the two-way set-associativity mapping and the address bits that identify the tag field, the set number, and the word number. d. Show the sector mapping with four blocks per sector and the address bits that identify the sector number, the block number, and the word number Answer : From the above statement, we get the memory and cache configuration information to calculate the identification bits and the addressing scheme. They are : Main memory has 64 blocks → 64 6n s= ↔ = because 2s n = Cache memory has 8 block frames 8 3m r→ = ↔ = because 2r m = Block size is 8 words 8 3b w→ = ↔ = because 2w b = a. Direct mapping cache Tag field = 6 3 3s r− = − = bit Block field = 3r = bit Word field = 3w = bit
  • 3. Arwin – 23206008@2006 2 The addressing and mapping scheme are as followed :
  • 4. Arwin – 23206008@2006 3 b. 8-way Fully associativity cache Tag field = 6s = bit Word field = 3w = bit The addressing and mapping scheme are as followed :
  • 5. Arwin – 23206008@2006 4 c. 2-way Set associativity cache Set = 4 2v d= ↔ = because 2d v = Tag field = 6 2 4s d− = − = bit Set field = 2d = Word field = 3w = bit For 2-way associativity cache implementation, there will be 4 sets where each set consists of 2 block frames (subsets) and each subset will cover 2 main memory blocks. The 4-bit tag determines which 2 main memory’s blocks have right access to a particular set at a time (see the table below). Set Number (2 bits) Block Frame Number Memory Block Number (2-way associativity) 0 (00) 0 1B dan B 0, 16 and 32, 48 1 (01) 2 3B dan B 1, 17 and 33, 49 2 (10) 4 5B dan B 2, 18 and 34, 50 3 (11) 6 7B dan B 3, 19 and 35, 51 0 (00) 0 1B dan B 4, 20 and 36, 52 1 (01) 2 3B dan B 5, 21 and 37, 53 2 (10) 4 5B dan B 6, 22 and 38, 54 3 (11) 6 7B dan B 7, 23 and 39, 55 0 (00) 0 1B dan B 8, 24 and 40, 56 1 (01) 2 3B dan B 9, 25 and 41, 57 2 (10) 4 5B dan B 10, 26 and 42, 58 3 (11) 6 7B dan B 11, 27 and 43, 59 0 (00) 0 1B dan B 12, 28 and 44, 60 1 (01) 2 3B dan B 13, 29 and 45, 61 2 (10) 4 5B dan B 14, 30 and 46, 62 3 (11) 6 7B dan B 15, 31 and 47, 63
  • 6. Arwin – 23206008@2006 5 The addressing and mapping scheme are as followed :
  • 7. Arwin – 23206008@2006 6 d. 4-block Sector cache 64 memory’s blocks are divided into 16 sectors which each sector contains 4 blocks. 8 cache’s block frames are divided into 2 sectors which each sector contains 4 block frames. Block field = 4 bits to cover 16 sectors of the main memory. Tag field = 3 bits which is divided into 2 functions, selection bit and sector bit. Sector Number (1 bit) Block Frame Number Sector Number MemoryBlock Number 0 0 3B dan B 1 4 7B dan B 0,1,.......,15 0 1 63, ,...........,B B B 0 0 3B dan B 1 4 7B dan B 0,1,.......,15 0 1 63, ,...........,B B B The addressing and mapping scheme are as followed :
  • 8. Arwin – 23206008@2006 7 This 4-block sector mapping scheme allows each memory’s sector placed in any of the available cache’s block frames in fully associative mode.
  • 9. Arwin – 23206008@2006 8 Problem 5.9 – Consider a cache ( )1M and memory ( )2M hierarchy with the following characteristics : 1 :M 16 Kwords, 50 ns access time. 2 :M 1 Mwords, 400 ns access time. Assume eight-word cache blocks and a set size of 256 words with set-associative mapping. a. Show the mapping between 2M and 1M . b. Calculate the effective memory access time with a cache hit ratio of 0.95h = . Answers : a. Mapping between 2M and 1M . From the above statement we collect some information such that : 1 block = 8 word 3 2 3b w→ = ↔ = . 16 Kwords cache 14 2m m= ↔ = words = 14 3 11 2 2− = block frames or 2,048 block frames starting from 0 2,047B B− . So that 11r = bits. 1 Mwords memory 20 2n n= ↔ = words = 20 3 17 2 2− = memory blocks or 131,072 blocks starting from 0 131,071B B− . So that 17s = bits. Set size, 8 256 2k = = words or 8 3 5 2 2k − = = blocks. There will be 32-way associativity. Then, number of sets, 11 6 5 2 2 2 m v k = = = or 64 sets starting from 0 63S S− . Hence, each set will consist of 32 block frames. The bit set number, 2log 6d v= = bits. Word field = 3 bits. Set field = 6 bits to cover 64 sets of the cache memory. Tag field = 17 6 11s d− = − = bits.
  • 10. Arwin – 23206008@2006 9 Mapping Table Set Number (6 bits) Block Frame Number Memory Block Number (32-way associativity) 0 (000000) 0 1 32, ,.......,B B B 0, 64, 128, ……, 131008 1 (000001) 33 34 63, ,.......,B B B 1, 65, 129, ……, 131009 2 (000010) 64 65 95, ,.......,B B B 2, 66, 130, ……, 131010 3 (000011) 96 65 127, ,.......,B B B 3, 67, 131, ……, 131011 ………….. …………. ………………. 36 (100100) 1152 65 1183, ,.......,B B B 36, 100, 167, ……, 131047 ………….. …………. ………………. 63 (111111) 2016 65 2047, ,.......,B B B 63, 127, 191, ……, 131071
  • 11. Arwin – 23206008@2006 10 The mapping scheme is as followed :
  • 12. Arwin – 23206008@2006 11 b. The effective memory-access time can be derived as followed : The general formula for effective memory-access time is : 1 . n eff i i i T f t = = ∑ where n is th n -memory hierarchy. Because ( )( ) ( )1 2 11 1 ........ 1i i if h h h h−= − − − , the above formula can be rewritten as ( ) ( ) ( )1 1 1 2 2 1 2 2 11 ............ 1 ....... 1eff n nT h t h h t h h t h t−= + − + + − − What we’ve got are : Cache ( )1M access time, 1 50t = ns Memory ( )2M access time, 2 400t = ns Cache hit ratio, 1 0.95h = and the access to the outermost memory, 2M , is always hit or 2 1h = So, the effective memory-access time is : ( ) ( )( ) ( )( )( ) 1 1 1 2 21 0.95 50 1 0.95 1 400 47.5 20 67.5 effT h t h h t ns = + − = + − = + =