Basics of Memory Design
Basics of Memory Design
MEMORY DESIGN
1 Memory Hierarchy 5
1.1 Memory Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Levels of Memory Hierarchy: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.2 Cache Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 Main Memory (RAM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.4 Secondary Storage (Hard Disks, SSDs) . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.5 Tertiary Storage (Magnetic Tapes, Optical Disks) . . . . . . . . . . . . . . . . . . . . . 6
1.3 Classification Of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.1 Volatile Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3.2 Non-Volatile Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Memory Architecture 9
2.1 Generic Memory Array Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1 Memory is build as 2D Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2 Memory Cells are Grouped in a Sub-Array . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.3 Row & Column Decoders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.4 How You Read Data from Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1.5 Sub-Array Size Among Different Levels In The Memory Hierarchy . . . . . . . . . . . 11
2.2 Memory Cell Size and Equivalent Bit Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.1 What is Equivalent Bit Area? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Peripheral Circuits: Decoder, MUX, and Driver . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1 Row Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.2 Column Decoder and MUX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.3 Transmission Gates in MUX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3.4 Word Line (WL) Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3.5 Driver Design Trade-Offs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 SRAM 15
3.1 About Static Random Access Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 SRAM Cell Array & SRAM Cell Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.1 6T SRAM Cell Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3 SRAM Read Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4 SRAM Write Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4 DRAM 21
4.1 DRAM – Introduction and Properties: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 DRAM Cell Array & DRAM Cell Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2.1 DRAM Array Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 DRAM Write Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.4 DRAM Read Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.5 Current Trends in DRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.5.1 DDR Evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3
Ashish Verma’s LinkedIn 4
5 Non-Volatile Memory 27
5.1 Overview of Non-Volatile Memory (NVM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.1.1 Key Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.1.2 Common NVM Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1.3 How Do They Retain Data? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1.4 Typical Read/Write Tradeoffs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.2 Flash Memory : Theory, Architecture, and Read/Write . . . . . . . . . . . . . . . . . . . . . 28
5.2.1 About Flash Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.2.2 Flash Cell Design – Floating Gate Transistor . . . . . . . . . . . . . . . . . . . . . . . 29
5.2.3 Read Operation In Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2.4 Write & Erase Operation In Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . 30
Memory Hierarchy
5
Ashish Verma’s LinkedIn 6
Registers
Located inside the CPU
Store immediate data like operands, counters
Extremely fast (access time in nanoseconds)
Very limited in size (typically 8–32 general-purpose registers)
Cache Memory
Small memory between CPU and RAM
Stores frequently accessed data/instructions
Types:
L1 Cache: Closest to CPU, smallest and fastest
Ashish Verma’s LinkedIn 7
RAM
Used for storing runtime data like variables, stack, heap, buffers.
1. ROM (Pre-programmed)
2. Flash Memory (USB,Microcontrollers)
3. Secondary Memory (HDD,SSD)
Memory Architecture
Figure 2.1:
Column decoder: Selects one group out of 2 column groups using N bits via the column multiplexer
N
Ö Ö Ö
(I/O) width from the sub-array is k-bit.
In total, there are 2M rows and k 2N columns; thus, k 2M 2N cells.
Example: Let’s take:
22 =4 column groups.
N=2
23 =8 rows
M=5
K=2 Each column group has 2 columns
So total columns = k Ö2 N
=2 Ö 4 = 8 columns
Figure 2.2:
Let say:
You want to read from row 5 (address 101)
You want to read column group 2 (address 10)
That means:
You enable Row 5.
You enable column group 2 (C4, C5 because k=2)
Ashish Verma’s LinkedIn 11
F is the minimum area that a single feature (like a wire or transistor) takes.
2
SRAM: One car takes 6 spots = lots of space per car (fast but expensive)
DRAM: One car takes 1 spot and a post-it (capacitor)
NAND Flash: One car has 4 passengers (n = 4 bits), and the lot is multilevel
Ö
Second stage: decode remaining 4 bits 16 rows per group
So: 16 16 = 256 rows are addressable.
This reduces wire lengths and transistor count.
The decoder design applies to both row decoding and column decoding.
The column selection needs a MUX that is controlled by the column decoder.
The MUX typically employs transmission gates.
Figure 6 shows an example of a 16-to-1 MUX that is controlled by a 4-to-16 decoder (which could be the
second stage of the two-stage decoder).
Figure 2.7: Design options for the WL driver with various optimization goals: (a) latency optimized; (b)
area optimized; (c) balance between latency and area.
Chapter 3
SRAM
15
Ashish Verma’s LinkedIn 16
Figure 3.1: SRAM Bit Cells (Source:MIT OCW 6.004 Computation Structures)
Figure-2 shows the circuit schematic of the commonly used 6-transistor (6T) SRAM cell.
The core of the 6T cell includes:
– INV1 and INV2: Two cross-coupled inverters l.e Complementary storage nodes.
– N1 and N2: These ate two storage nodes of the SRAM cell, as the data are stored at one
of these two nodes.
– BL and BL (Bit Lines): The storage nodes are connected to BL and BL through two
access transistors, whose gates are controlled by the same wordline (WL).
– WL (Word Line): Controls access to the cell.
Ashish Verma’s LinkedIn 17
The cell provides stable storage in the sense that as long as there’s power, the noise immunity of
the inverters will ensure that the logic values will be maintained even if there’s electrical noise on
either inverter input.
Figure 3.3: Bistable element (two stable states), stores a single bit
If N1 stores “1” with a voltage at the power supply (VDD), then N2 must store “0” with a voltage at
the ground.
There is only 1-bit information is stored in the 6T cell, and it is typically regarded as being stored at
N1.
Figure 3.4: SRAM read operation with major current flow path.
1. The drivers first recharge all the bitlines(BL and BL) to VDD (logical 1 value) and then disconnect,
leaving the bitlines floating at 1.
2. Then the address decoder sets one of the wordlines high, connecting a row of bit cells to their bitlines.
Ashish Verma’s LinkedIn 18
3. Each cell in the selected row then pulls one of its two bitlines to GND. In this example, it’s the right
bitline that’s pulled low.
N1 = 0 and N2 = 1, BL start discharging and BL stay at high.
4. A small voltage difference (e.g., 100 mV) builds up between BL and BL.
5. Now sense amplifier comes in picture. A sense amplifier compares the two and rapidly drives the output
to logic level:
If BL > BL Output = 1
If BL < BL Output = 0
6. Word Line Deactivation: After sensing is done, WL is pulled low to turn off access transistors.
BL and BL go back to precharge phase for next operation.
Figure 3.5: (a) Principle of the SRAM write operation in the 1st phase that “1” to “0” transition is initiated.
(b) “0” to “1” transition is followed in the 2nd phase.
1. Bit Lines (BL and BL) are driven externally with the value to be written. Write drivers pull BL and
BL to the desired logic levels.
3. Cell Overwrite: The strong write drivers force the voltage onto N1 and N2.
If we are writing ‘1’: N1 = 1, N2 = 0
If we are writing ‘0’: N1 = 0, N2 = 1
4. Word Line Deactivation: After a short write pulse ( a few ns), WL is pulled low.
Access transistors turn off.
The new value is now latched in the cross-coupled inverter.
5. Bit Line Released: BL and BL are disconnected by disabling the write drivers. They return to the
precharge phase for the next operation.
Ashish Verma’s LinkedIn 20
Chapter 4
DRAM
21
Ashish Verma’s LinkedIn 22
2. Activate Word Line:
Row decoder selects the required row WL goes high.Access transistor (T) turns ON.
Bit Line and Capacitor are now connected.
3. Data Stored in Capacitor:
If BL = VDD capacitor charges up stores logic ‘1’
If BL = 0 capacitor discharges stores logic ‘0’
This state remains as long as leakage doesn’t drain the capacitor (hence refresh needed).
4. Deactivate Word Line:
WL is pulled low Access transistor turns OFF
Cell is isolated with data stored as charge or no charge
Ashish Verma’s LinkedIn 24
1. Precharge Phase:
Bitline (BL) is precharged to VDD/2.
Then the precharge circuitry is disconnected.
This sets a reference voltage so the sense amplifier can detect small deviations
2. Activate Word Line:
The wordline is activated, connecting the storage capacitor of the selected cell to the bitline.
It further cause the charge on the capacitor to be shared with the charge stored by the capacitance of
the bitline.
3. As now capacitor and bitline share charge
If capacitor was discharged, bitline voltage decreases slightly.
If capacitor was charged, bitline voltage increases slightly.
4. Sense amplifiers are used to detect this small voltage change to produce a digital output value.
5. Since reading shares charge with BL, it disturbs the capacitor value, this means that read operations
wipe out the information stored in the bit cell, which must then be rewritten with the detected value
at the end of the read operation.
6. The sense amplifier restores the correct charge back into the cell immediately
Non-Volatile Memory
Non-Volatile Memory (NVM) is a type of memory that retains data even after power is turned off. Unlike
DRAM and SRAM, which are volatile, NVMs store data permanently or semi-permanently using mechanisms
like charge trapping, magnetic state, or resistance change.
Property Description
Data Retention Data is retained even without power
Speed Slower than SRAM/DRAM but improving
Durability (Write cycles) Limited for some types (e.g., EEPROM)
Density Higher than SRAM, lower than DRAM in some cases
Use Cases Storage (SSDs), firmware, configuration memory
27
Ashish Verma’s LinkedIn 28
Flash memories can only be written some number of times before the insulating layer is damaged to the
point that the floating gate will no longer reliably store charge.
Currently the number of guaranteed writes varies between 100,000 and 1,000,000. To work around this
limitation, flash chips contain clever address mapping algorithms so that writes to the same address actually
are mapped to different flash cells on each successive write.
Single-Level Cells (SLCs), are able to store one bit of information, while Multi-Level Cells (MLCs) allow to
store more than one bit per cell, by choosing between multiple levels of electrical charge in the floating gate
of a cell.
3. Depending on the threshold voltage (Vth):
If no charge in floating gate transistor turns ON current flows logic 1
If charge is present Vth is high transistor stays OFF no current logic 0
Ashish Verma’s LinkedIn 30
Table 5.5: Threshold Voltage and Output Relation in Flash Memory Cells
Today we are going to cover commonly used NVMs and their architecture. Let’s have a overview:
Flash memory is a type of electrically erasable non-volatile memory that stores data by trapping charge in
Floating Gate Transistor. We already saw in previous chapter that how floating gate transistor are construed
and how can we read, erase and write data in it. Now let’s move to its types this section.
33
Ashish Verma’s LinkedIn 34
It gets its name from the way cells are connected, only if all word lines are pulled high (above the transistors
Vt ), the bit line is pulled low. This resembles a NAND gate.
Unlike NOR, which supports fast random access, NAND is optimized for block-based sequential access,
making it ideal for SSDs, USB drives, SD cards, and mobile storage.
It can also serve as the programming path during write.
BL = 0V cell gets programmed (electrons injected).
BL = High (e.g., 5V) inhibits programming.
Unit Description
Cell Single floating gate transistor
Page Group of cells (e.g., 2–16 KB)
Block Set of pages (64–512 pages/block)
Plane Collection of blocks
Die One full chip (multiple planes)
How it works?
If any one transistor conducts, current flows read logic ’1’
If all transistors are OFF, no current read logic ’0’
Element Description
Bit Line (BL) Vertical line shared by all transistors in a column
Word Line (WL) Each WL activates one cell in the row
P-type Substrate Channel layer for electron movement
N-well Source/drain diffusion regions
Floating Gate Transistor Traps charge to store bit (0 or 1)
Bitlines
During read: Sense current at the bit line.
Apply small voltage to BL, source = ground
If current flows cell is erased = 1.
If no current cell is programmed = 0.
During write:
Selected BL (Drain): Apply program voltage (5V) and we have Source: Ground. we want to inject electrons.
WordLines(WL)
During read:
Apply 5Vto selected WL.
Unselected WLs = 0V.
During write:
Selected WL: Apply high voltage
Source: GND
During Erase:
WLs = 0V.
Source = High ( 12V).
BL (drain) = Floating.
The following steps are needed to write or program a NOR flash cell to 0:
2. Assuming an NMOS transistor, the channel is now turned on so electrons can flow from the source to
the drain
3. If the source to drain current is sufficiently high, there will be some high energy electrons able to jump
from the channel through the insulating layer into the floating gate. This process is called hot-electron
injection.
Ashish Verma’s LinkedIn 37
4. Now there is charge trapped in the floating gate and thus the threshold voltage Vt is shifted due to the
partial cancelation of the electric field from the control gate.
6.3 EEPROM
EEPROM is a type of non-volatile memory, meaning it retains data even when power is turned off. It can
be electrically erased and reprogrammed, unlike earlier PROMs (Programmable ROMs), which could be
written only once or needed UV light to erase (UV EPROMs).
Before EEPROM:
ROM was fixed (data set at manufacturing).
PROM could be programmed once.
EPROM was erasable but needed UV light (slow and impractical in-circuit).
EEPROM cells are also based on floating-gate MOSFETs.A control gate and a floating gate. A thin oxide
layer separating the floating gate from the channel.Source and drain as in normal MOSFETs.
Ashish Verma’s LinkedIn 38
Read:
MRAM was developed to combine the speed of SRAM, the density of DRAM, and the non-volatility of Flash.
Unlike conventional RAM chip technologies, data in MRAM is not stored as electric charge or current flows,
but by magnetic storage elements. Its advantages include:
1. Magnetic Tunnel Junction (MTJ): It is the core storage element.In MTJ, two ferromagnetic layers
separated by a thin insulating tunnel barrier.
One of the two plates is a permanent magnet set to a particular polarityr(Pinned layer).
The other layer’s magnetization can be changed (free layer).
2. Bit Line and Word Line: Used to select and access individual cells.
43
Ashish Verma’s LinkedIn 44
A failure in Contact No. 1 will result in the failure of one cell : Single bit Failure
A failure in Contact No. 2 will result in the failure of two cells: Double bit Failure
A failure in Contact No. 3 will result in the failure of four cells: Quad bit Failure
Hence, similar manufacturing defect at different location can result in a different outcomes.
Any single defect can be corrected by replacing two rows when a failure is observed. If we have two spare
rows, we can fix the issue.