Memory_slides
Memory_slides
1
Outline
…
– m x n: m words of n bits each
– k = Log2(m) address input signals
m words
…
– 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
• 8 input/output data signals
r/w
2k × n read and write
• Memory access enable memory
Ak-1
– multiport: multiple accesses to different locations …
simultaneously
Qn-1 Q0
Write ability/ storage permanence
permanence
Storage
– ROM Mask-programmed ROM Ideal memory
• read only, bits stored without power
OTP ROM
– RAM Life of
product
• read and write, lose stored bits without
power Tens of EPROM EEPROM FLASH
years
• Traditional distinctions blurred Battery Nonvolatile NVRAM
life (10
– Advanced ROMs can be written to years)
• e.g., EEPROM In-system
SRAM/DRAM
– Advanced RAMs can hold bits without programmable
Near
power zero Write
ability
• e.g., NVRAM
During External External External External
• Write ability fabrication programmer, programmer, programmer programmer
In-system, fast
writes,
only one time only 1,000s OR in-system, OR in-system,
– Manner and speed a memory can be of cycles 1,000s block-oriented
unlimited
cycles
of cycles writes, 1,000s
written of cycles
• Storage permanence
– ability of memory to hold stored bits Write ability and storage permanence of memories,
after they are written showing relative degrees along each axis (not to scale).
Write ability
• Ranges of write ability
– High end
• processor writes to memory simply and quickly
• e.g., RAM
– Middle range
• processor writes to memory, but slower
• e.g., FLASH, EEPROM
– Lower range
• special equipment, “programmer”, must be used to write to memory
• e.g., EPROM, OTP ROM
– Low end
• bits stored only during fabrication
• e.g., Mask-programmed ROM
• In-system programmable memory
– Can be written to by a processor in the embedded system using the
memory
– Memories in high end and middle range of write ability
Storage permanence
• Range of storage permanence
– High end
• essentially never loses bits
• e.g., mask-programmed ROM
– Middle range
• holds bits days, months, or years after memory’s power source turned off
• e.g., NVRAM
– Lower range
• holds bits as long as power supplied to memory
• e.g., SRAM
– Low end
• begins to lose bits almost immediately after written
• e.g., DRAM
• Nonvolatile memory
– Holds bits after power is no longer supplied
– High end and middle range of storage permanence
ROM: “Read-Only” Memory
• Nonvolatile memory
• Can be read from but not written to, by a
processor in an embedded system External view
…
• Uses Ak-1
…
lines Q2 and 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
Mask-programmed ROM
0V
displayed.
floating gate
– (a) Negative charges form a channel between source and drain The picture
The picture can't
can't be
be displayed.
displayed. The picture can't be displayed.
logic 0
– (c) (Erase) Shining UV rays on surface of floating-gate causes
negative charges to return to channel from floating gate restoring +15V
the logic 1
source drain
– (d) An EPROM package showing quartz window through which (b)
• Extension of EEPROM
– Same floating gate principle
– Same write ability and storage permanence
• Fast erase
– Large blocks of memory erased at once, rather than one word at a time
– Blocks typically several thousand bytes large
• Writes to single words may be slower
– Entire block must be read, word updated, then entire block written back
• Used with embedded systems storing large data items in
nonvolatile memory
– e.g., digital cameras, TV set-top boxes, cell phones
RAM: “Random-access” memory
external view
• Typically volatile memory r/w 2k × n read and write
enable
– bits are not held without power supply memory
A0
• Read and written to easily by embedded system …
Ak-1
during execution …
– each input and output data line connects to each 4×4 RAM
cell in its column
enable 2×4
decoder
– rd/wr connected to every cell
A0
– when row is enabled by decoder, each cell has logic A1
Memory
that stores input data bit when rd/wr indicates write cell
rd/wr
or outputs stored bit when rd/wr indicates read To every cell
Q3 Q2 Q1 Q0
Basic types of RAM
90 ns access time
20 mA Active current
100 mA Standby current
Reading Waveforms
Programming Waveforms
Example:
TC55V2325FF-100 memory device
• 2-megabit data<31…0> Device
TC55V23
Access Time (ns)
10
Standby Pwr. (mW)
na
Active Pwr. (mW)
1200
Vcc Voltage (V)
3.3
addr<10...0>
burst SRAM memory device characteristics
/CS1
device /CS2 A single read operation
• Designed to be CS3
CLK
interfaced with 32-bit /WE
/ADSP
processors /OE
/ADSC
MODE
• Capable of fast /ADV
/ADSP
sequential reads and /ADSC
addr <15…0>
/WE
writes as well as /ADV /OE
TC55V2325F CS3
F-100
data<31…0>
block diagram
timing diagram
Burst mode (alternatively burst-mode, with an hyphen) is a generic computing term referring to any situation in which a device is
transmitting data repeatedly without waiting for input from another device or waiting for an internal process to terminate before
continuing the transfer of data.
LVTTL
Composing memory
• Memory size needed often differs from size of readily Increase number of words
available memories 2m+1 × n ROM
2m × n ROM
• When available memory is larger, simply ignore unneeded
high-order address bits and higher data lines A0
… …
Am-1
• When available memory is smaller, compose several smaller 1×2 …
memories into one larger memory Am decoder
2m × n ROM
– Connect side-by-side to increase width of words
enable
– Connect top to bottom to increase number of words …
• added high-order address line selects smaller memory …
containing desired word using a decoder
– Combine techniques to increase number and width of words
…
Qn-1 Q0
2m × 3n ROM
enable 2m × n 2m × n 2m × n A
memory
– Can be multiple levels of
cache
Cache
indicated by index V T D
• if tags match, check valid bit
• Valid bit Data
from memory
• Offset
– used to find particular word in cache line
Fully associative mapping
Tag Offset
Data
V T D V T D V T D
…
Valid
= =
=
Set-associative mapping
0.16
0.14
0.12
0.1 1 way
% cache miss
2 way
0.08
4 way
0.06 8 way
0.04
0.02
0
cache size
1 Kb 2 Kb 4 Kb 8 Kb 16 Kb 32 Kb 64 Kb 128 Kb
Advanced RAM
Data In Buffer
Sense
strobing ras and cas signals, Amplifiers
Col Decoder
rd/wr cas
respectively
Row Decoder
Row Addr. Buffer
or internal to DRAM device
ras
– strobes consecutive memory address
Bit storage array
address periodically causing
memory content to be refreshed
– Refresh circuitry disabled
during read or write operation
Fast Page Mode DRAM (FPM DRAM)
ras
cas
ras
cas
ras
cas
address
row col
data
data data data
Rambus DRAM (RDRAM)
• Duties of MMU
– Handles DRAM refresh, bus interface and arbitration
– Takes care of memory sharing among multiple
processors
– Translates logic memory addresses from processor to
physical memory addresses of DRAM
• Modern CPUs often come with MMU built-in
• Single-purpose processors can be used