Computer Memory Architecture
Computer Memory Architecture
CPU
Increasing distance
Level 1
from the CPU in
access time
Level n
Processor Processor
Princeton
Fewer memory
wires
Harvard Program Data memory Memory
memory (program and data)
Simultaneous
program and data
memory access Harvard Princeton
Memory Access Process
Physical
Address
Virtual Tag
address hit miss
CPU Main
TLB Cache
Memory
miss hit
Address
Translation
data
logical physical
address memory address main
CPU management
memory
unit
Memory Data Organization
Endianness
Big Endian/Little Endian
m words
…
k = Log2(m) address input signals
or m = 2^k words
e.g., 4,096 x 8 memory: n bits per word
32,768 bits
12 address input signals memory external view
…
Uses Ak-1
…
Store software program for general-purpose processor
Qn-1 Q0
program instructions can be one or more ROM words
Store constant data needed by system
Implement combinational circuit
Example: 8 x 4 ROM
Horizontal lines = words Internal view
programmable
Word 2 is not connected with data lines Q2 and connection wired-OR
Q0 Q3 Q2 Q1 Q0
Output is 1010
Implementing combinational function
Any combinational circuit of n functions of same k variables can be done with 2^k x n
ROM
Truth table
Inputs (address) Outputs
a b c y z 8×2 ROM
0 0 word 0
0 0 0 0 0
0 0 1 0 1 0 1 word 1
0 1 0 0 1 0 1
0 1 1 1 0 enable 1 0
1 0 0 1 0 1 0
1 0 1 1 1 c 1 1
1 1 0 1 1 b 1 1
1 1 1 1 1 1 1 word 7
a
y z
Types of ROM
Written during manufacture
Programmable (once)
PROM
Needs special equipment to program
Read “mostly”
Erasable Programmable (EPROM)
Erased by UV
can program and erase individual words
Electrically Erasable (EEPROM)
Takes much longer to write than read
can program and erase individual words as well
Flash memory
Large blocks of memory read/write at once, rather than one word at a time
Faster erase
RAM
external view
Q3 Q2 Q1 Q0
Types of RAM
SRAM: Static RAM
Memory cell uses flip-flop to store bit
Holds data as long as power supplied
27 /WE 20 /CS
20 /CS1
Device Access Time (ns) Standby Pwr. (mW) Active Pwr. (mW) Vcc Voltage (V)
HM6264 85-100 .01 15 5
27C256 90 .5 100 5
device characteristics
data data
addr addr
OE WE
/CS1 /CS1
CS2 CS2
timing diagrams
Composing memory
Increase number of words
Memory size needed often differs from size of readily available
2m+1 × n ROM
memories 2m × n ROM
When available memory is larger, simply ignore unneeded high- A0
… …
order address bits and higher data lines Am-1
1×2 …
When available memory is smaller, compose several smaller Am decoder
A
2m × 3n ROM
Increase number
enable 2m × n ROM 2m × n ROM 2m × n ROM
and width of
Increase width words
A0 … … …
of words enable
Am
… … … outputs
Q3n-1 Q2n-1 Q0
Summary
Memory hierarchy
Memory/processor architecture
Memory access process
Endianness
Data alignment
Memory data organization
Memory devices
Basics
ROM/RAM