Lec13 Memory 1 Notes
Lec13 Memory 1 Notes
Lec13 Memory 1 Notes
Spring 2022
Introduction
Review: Major Components of a Computer
Processor Devices
Control Input
Memory
Datapath Output
Memory
Main
Cache
Secondary
Memory
(Disk)
3/24
Why We Need Memory?
Combinational Circuit:
• Always gives the same output for a given set of inputs
• E.g., adders
Sequential Circuit:
• Store information
• E.g., counter
4/24
Who Cares About the Memory Hierarchy?
1000 Processor
Processor Growth Curve follows CPU
60%/yr.
“Moore’s Law”
Performance
(2x/1.5 yr)
100 Processor-Memory
Performance Gap:
(grows 50% / year)
10
DRAM
DRAM
9%/yr.
1 (2x/10 yrs)
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
Time
Processor-DRAM Memory Performance Gap
5/24
6/24
7/24
Memory System Revisted
E.g.
16-bit addresses can only address 216 = 65536 memory locations
8/24
Simplified View
Data transfer takes place through
• MAR: memory address register
• MDR: memory data register
Processor Memory
k-bit
address bus
MAR
n -bit
data bus
Up to 2 k addressable
MDR locations
9/24
Big Picture
10/24
Characteristics of the Memory Hierarchy
Processor
Inclusive–
4-8 bytes (word) what is in L1$
is a subset of
Increasing L1$ what is in L2$
distance 8-32 bytes (block) is a subset of
from the L2$ what is in MM
processor that is a
1 to 4 blocks
in access subset of is in
time Main Memory
SM
1,024+ bytes (disk sector = page)
Secondary Memory
11/24
Memory Hierarchy: Why Does it Work?
12/24
Memory Hierarchy: Why Does it Work?
12/24
Memory Hierarchy
Processor
Control Tertiary
Secondary Storage
Storage (Tape)
Second Main
(Disk)
On-Chip
Registers
Level Memory
Cache
14/24
Terminology
15/24
Terminology
• Hit Rate: the fraction of memory accesses found in a level of the memory hierarchy
• Miss Rate: the fraction of memory accesses not found in a level of the memory
hierarchy, i.e. 1 - (Hit Rate)
Hit Time
Time to access the block + Time to determine hit/miss
Miss Penalty
Time to replace a block in that level with the corresponding block from a lower level
16/24
Bandwidth v.s. Latency
Example
• Mary acts FAST but she’s always LATE.
• Peter is always PUNCTUAL but he is SLOW.
17/24
Bandwidth v.s. Latency
Example
• Mary acts FAST but she’s always LATE.
• Peter is always PUNCTUAL but he is SLOW.
Bandwidth:
• talking about the “number of bits/bytes per second” when transferring a block of
data steadily.
Latency:
• amount of time to transfer the first word of a block after issuing the access signal.
• Usually measure in “number of clock cycles” or in ns/µs.
17/24
Question:
Suppose the clock rate is 500 MHz. What is the latency and what is the bandwidth,
assuming that each data is 64 bits?
Clock
Row
Access
Strobe
Data d0 d1 d2
18/24
• 500 MHz = 2.0 × 10−9 second
• latency = 5 cycle = 10−8 second
8
• bandwidth = = 4 × 109 byte / second.
2 × 10−9
19/24
Information Storage
Storage based on Feedback
21/24
Storage based on Feedback
21/24
How to change the value stored?
22/24
QUESTION:
What’s the Q value based on different R, S inputs?
• R=S=1:
• S=0, R=1:
• S=1, R=0:
• R=S=0:
23/24
How to remember?
• S: set
• R: re-set
24/24