You are on page 1of 41

1

Memory

LECTURE-17-18

Computer Organization Computer Architecture


Pipelining and Vector Processing 2 Pipelining

Memory Organization

Computer Organization Computer Architecture


3

Memory Organization

Computer Organization Computer Architecture


4

Memory Organization

Computer Organization Computer Architecture


5

Memory Organization

Computer Organization Computer Architecture


6

Memory Organization

Computer Organization Computer Architecture


7

Memory Organization

Computer Organization Computer Architecture


8

Memory Hierarchy

Computer Organization Computer Architecture


9

Memory Hierarchy

Computer Organization Computer Architecture


10

Memory Hierarchy

Computer Organization Computer Architecture


11

Memory Hierarchy

Computer Organization Computer Architecture


12

Main Memory

Computer Organization Computer Architecture


13

Main Memory

Computer Organization Computer Architecture


14

Main Memory

Computer Organization Computer Architecture


15

Main Memory

Computer Organization Computer Architecture


16

Main Memory: Memory address map

Computer Organization Computer Architecture


17

Main Memory: Memory address map

Computer Organization Computer Architecture


18

Main Memory: Memory address map

Computer Organization Computer Architecture


19

Main Memory: Memory address map

Memory address map &


Connection to CPU

Computer Organization Computer Architecture


20

Cache Memory

Computer Organization Computer Architecture


21

Cache Memory

Computer Organization Computer Architecture


22

Cache Memory

Computer Organization Computer Architecture


23

Cache Memory

Computer Organization Computer Architecture


24

Cache Memory

Computer Organization Computer Architecture


25

Cache Memory – Associative Mapping

Computer Organization Computer Architecture


26

Cache Memory – Associative Mapping

Computer Organization Computer Architecture


27

Cache Memory – Associative Mapping

 The argument register A and key register K each have n bits, one for each bit
of a word.
 The match register M has m bits, one for each memory word.
 Only the three leftmost bits of A are compared with memory words because K
has 1's in these position.
Computer Organization Computer Architecture
28

Cache Memory – Direct Mapping

Computer Organization Computer Architecture


29

Cache Memory – Direct Mapping

Computer Organization Computer Architecture


30

Cache Memory – Direct Mapping

Computer Organization Computer Architecture


31

Cache Memory – Direct Mapping

Computer Organization Computer Architecture


32

Cache Memory – Direct Mapping

Computer Organization Computer Architecture


33

Cache Memory – Direct Mapping

Computer Organization Computer Architecture


34

Cache Memory – Direct Mapping

Computer Organization Computer Architecture


35

Direct Mapped Cache Example

Computer Organization Computer Architecture


36

Direct Mapped Cache Example

Computer Organization Computer Architecture


37

Address Mapping using Pages

The table implementation of the address mapping is simplified if


the information in the address space and the memory space are
each divided into groups of fixed size.
The physical memory is broken down into groups of equal size
called blocks, which may range from 64 to 4096 words each.
The term page refers to groups of address space of the same size.
Consider a computer with an address space of 8K and a memory
space of 4K.
If we split each into groups of 1K words we obtain eight pages
and four blocks as shown in figure.
At any given time, up to four pages of address space may reside
in main memory in any one of the four blocks.

Computer Organization Computer Architecture


38

Address Mapping using Pages

Computer Organization Computer Architecture


39

Memory Table in Paged System


 The memory-page table consists of eight words, one for each page.
 The address in the page table denotes the page number and the
content of the word give the block number where that page is stored
in main memory.
 The table shows that pages 1, 2, 5, and 6 are now available in main
memory in blocks 3, 0, 1, and 2, respectively.
 A presence bit in each location indicates whether the page has been
transferred from auxiliary memory into main memory.
 A 0 in the presence bit indicates that this page is not available in main
memory.
 The CPU references a word in memory with a virtual address of 13
bits.
 The three high-order bits of the virtual address specify a page number and also
an address for the memory-page table.
 The three high-order bits of the virtual address specify a page number and also
an address for the memory-page table.
 The content of the word in the memory page table at the page number address is
read out into the memory table buffer register.
 If the presence bit is a 1, the block number thus read is transferred to the two
high order bits of the main memory address register.
Computer Organization Computer Architecture
40

Memory Table in Paged System


 A read signal to
main memory
transfers the
content of the
word to the main
memory buffer
register ready to
be used by the
CPU.
 If the presence bit
in the word read
from the page
table is 0, it
signifies that the
content of the
word referenced
by the virtual
address does not
reside in main
memory.
Computer Organization Computer Architecture
41

Logical to Physical Address Mapping

Computer Organization Computer Architecture

You might also like