Computer Architecture: Lecture: 9 - 13 Types of Memories Cache, Internal and External

You might also like

Download as odp, pdf, or txt
Download as odp, pdf, or txt
You are on page 1of 69

Computer Science 421 Fall 2019

Computer Architecture

Lecture : 9 -13
Types of Memories;
Cache, Internal and External

Saad A. Malik
saad.ali@namal.edu.pk
Lecture Outline

● Overview
● Cache memory
● Internal memory
● External memory

CSE-421 Saad A. Malik 2


Computer System Memory Overview

CSE-421 Saad A. Malik 3


Overview
➢ Although seemingly simple in concept, computer memory
exhibits perhaps the widest range of type, technology,
organization, performance, and cost of any feature of a
computer system.

➢ No one technology is optimal in satisfying the memory


requirements for a computer system.

● As a consequence, the typical computer system is equipped


with a hierarchy of memory subsystems, some internal to
the system (directly accessible by the processor) and some
external (accessible by the processor via an I/O module).

CSE-421 Saad A. Malik 4


CSE-421 Saad A. Malik 5
CSE-421 Saad A. Malik 6
Chapter 4
Cache Memory

CSE-421 Saad A. Malik 7


Cache Memory Principles

CSE-421 Saad A. Malik 8


Structure of Cache Memory

CSE-421 Saad A. Malik 12


Cache Read Operation

CSE-421 Saad A. Malik 13


Cache Organization

CSE-421 Saad A. Malik 14


Elements of Cache Design

CSE-421 Saad A. Malik 15


Introduction

● Caches performances are generally referred to


in High Performance Computing (HPC)
applications.
– Many researchers have found that HPC applications
perform poorly on computer architectures that employ
caches [BAIL93].
– Other researchers have since shown that a cache
hierarchy can be useful in improving performance if
the application software is tuned to exploit the cache
[WANG99, PRES01].

CSE-421 Saad A. Malik 16


Although there are a large number of cache implementations, but there are a few
basic design elements that serve to classify and differentiate cache architectures.
Table 4.2 lists key elements.

CSE-421 Saad A. Malik 17


Cache Addresses


Virtual Memory
– Address fields of machine instructions contain virtual addresses
– A hardware memory management unit translates each virtual
address to physical address in main memory
– We shall not cover this topic in detail
● Physical Memory
– Map each line to a physical memory address
– A memory translation is required
– Placement of the memory translation becomes the bone of
contention

CSE-421 Saad A. Malik 18


Cache Size

● Desirable
– Size of cache large enough or small enough
– Access time
– Cost per bit
● Large caches tend to be slower, because of
address translations
● Available chip and board area limits the size

CSE-421 Saad A. Malik 19


Replacement Algorithms

● Problem:
– When a new block of memory is brought into a
cache, one of the existing blocks must be replaced
● Possible Solutions:
– Least Recently Used (LRU)
– First in First Out (FIFO)
– Least Frequently Used (LFU)

CSE-421 Saad A. Malik 20


Write Policy

● If a word has been updated in Cache and not in main memory, which
memory should be updated
– The problem of identifying validity of word
● e.g. I/O device has changed word in main memory, where as instruction
changed the word in cache. Which is valid?
● e.g. when multiple processors are attached to the same bus and have own
local caches
– Then a write by one processor can invalidated other words
● Write Through
– All write operations are carried out in main memory as well as cache
– Add a new processor-cache monitoring module to maintain consistency of local
cahce
– This technique might cause

CSE-421 Saad A. Malik 21


Write Policy - Techniques

● Write through
– Main and Cache memory are simultaneously written
– DisAdv : substantial memory traffic is generated
● Write Back
– To minimize memory writes, updates only cache
– Concept of dirty bit or use bit, associated with line is
set
● Case Scenario: Bus organization
– How to maintain cache coherency?

CSE-421 Saad A. Malik 22


Line Size

● The size of Line incorporates


– The data block,
– The validity bit, dirty bit
– The address field (in case of set-
associative)
– In case of direct addressing no additional
fields need storage

CSE-421 Saad A. Malik 23


Number of Caches

● Single or Multi Level


– Logic density increase
– Larger or multiple caches are possible
● Onchip vs Offchip Cache?

CSE-421 Saad A. Malik 24


CSE-421 Saad A. Malik 25
Table 4.3 continued ..

CSE-421 Saad A. Malik 26


CSE-421 Saad A. Malik 27
Memory Mapping

● Direct Mapping
● Associative Mappings
● Set-associative Mapping

CSE-421 Saad A. Malik 28


CSE-421 Saad A. Malik 29
Key Terms

CSE-421 Saad A. Malik 30


CSE-421 Saad A. Malik 31
Recommended Readings

CSE-421 Saad A. Malik 32


End of Lecture

Questions and Answers

CSE-421 Saad A. Malik 33


Next Lecture

● Cache Mapping Functions


● Example Caches
– Intel
– ARM

CSE-421 Saad A. Malik 34


Internal Memory

CSE-421 Saad A. Malik 35


CSE-421 Saad A. Malik 36
Memory Organization

CSE-421 Saad A. Malik 37


CSE-421 Saad A. Malik 38
CSE-421 Saad A. Malik 39
Packaging

CSE-421 Saad A. Malik 40


Memory Organization

CSE-421 Saad A. Malik 41


Memory Organization

● In the case in which larger memory is required, an array of chips is needed. Figure 5.6 shows the possible
organization of a memory consisting of 1M word by 8 bits per word.
● In this case, we have four columns of chips, each column containing 256K words arranged as in Figure 5.5.
● For 1M word, 20 address lines are needed. The 18 least significant bits are routed to all 32 modules. The
high-order 2 bits are input to a group select logic module that sends a chip enable signal to one of the four
columns of modules.

CSE-421 Saad A. Malik 42


CSE-421 Saad A. Malik 43
SDRAM
● Synchronous Data RAM

CSE-421 Saad A. Malik 44


DDR

● SDRAM restricted to send data


once per bus clock cycle
● Double Data rate (DDR)
SDRAM overcomes this
restriction by sending data on
both rising and falling edge of
the clock.

CSE-421 Saad A. Malik 45


DRAMS Performance

CSE-421 Saad A. Malik 46


Key Terms

CSE-421 Saad A. Malik 47


CSE-421 Saad A. Malik 48
Recommended Readings

CSE-421 Saad A. Malik 49


External Memory

CSE-421 Saad A. Malik 50


Types

CSE-421 Saad A. Malik 51


Magnetic Disk

CSE-421 Saad A. Malik 52


Read Write Mechanism

● Watch video

CSE-421 Saad A. Malik 53


Layout of Data

CSE-421 Saad A. Malik 54


CSE-421 Saad A. Malik 55
Winchester Disk format
(HDD in PCs are mostly Winchester Type)

CSE-421 Saad A. Malik 56


Disk Performance Parameters
When the disk drive is operating, the disk is rotating at constant speed. To read or write, the
head must be positioned at the desired track and at the beginning of the desired sector on that
track. Track selection involves moving the head in a movable-head system or electronically
selecting one head on a fixed-head system.
● Seek time
– On a movable-head system the time it takes to position the head at the track
– A typical average seek time on contemporary hard disks is under 10 ms.
● Rotational Delay
– The time it takes for the beginning of the sector to reach the head is known as rotational delay, or
rotational latency.
– At 3600 rpm
– At 20,000 rpm there is one revolution per 3 ms. Thus, on the average, the rotational delay will be 1.5 ms.
● Access time
– Seek time + Rotational Delay
● Additional Delays
– Availability of disks
– Availability of I/O channel

CSE-421 Saad A. Malik 57


CSE-421 Saad A. Malik 58
CSE-421 Saad A. Malik 59
CSE-421 Saad A. Malik 60
CSE-421 Saad A. Malik 61
RAID

● As discussed earlier, the rate in improvement


in secondary storage performance has been
considerably less than the rate for processors
and main memory.
● This mismatch has made the disk storage
system perhaps the main focus of concern in
improving overall computer system
performance.

CSE-421 Saad A. Malik 62


CSE-421 Saad A. Malik 63
CSE-421 Saad A. Malik 64
CSE-421 Saad A. Malik 65
Optical

CSE-421 Saad A. Malik 66


CSE-421 Saad A. Malik 67
Optical Read Write

CSE-421 Saad A. Malik 68


Recommended Reading

CSE-421 Saad A. Malik 69


CSE-421 Saad A. Malik 70
Review

CSE-421 Saad A. Malik 71


Quiz

CSE-421 Saad A. Malik 72

You might also like