Chapter 9 Memory and storage
Chapter 9 Memory and storage
Operating Principles:
Despite the large capacity, modern memory modules operate on the same principles as
smaller units.
For simplicity, smaller units are often used to illustrate memory concepts.
Bit:
The smallest unit of binary data.
Represents a single binary value (0 or 1).
Byte:
An 8-bit unit of data.
Commonly used in many applications for data handling.
Can be split into two 4-bit units called nibbles.
Nibble:
A 4-bit unit, which is half of a byte.
Word:
In Memories: A group of bits or bytes that acts as a single entity, stored in one memory
location.
In Assembly Language: Specifically defined as two bytes (16 bits).
Cell:
Each storage element in a memory that can retain a binary value (1 or 0).
Referred to as a memory cell.
Memory Array:
Composed of arrays of cells.
Each cell's location is identified by specifying its row and column.
Address Bus
Is a set of lines used to select a memory address by placing a binary code
representing the desired address.
Address Decoding:
The address code is decoded internally to select the appropriate memory
location.
In multiple-array memories, separate decoders are used for rows and columns.
Capacity Dependence:The number of lines in the address
bus depends on memory capacity.
Examples:
15-bit address code: Can select 32,768 locations (2¹⁵).
16-bit address code: Can select 65,536 locations (2¹⁶).
32-bit address code: Can select 4,294,967,296 locations
(2³²) or 4 GB.
Write Operation
Process:
Step 1: Address code from the address register is placed on the
address bus.
Step 2: Address decoder decodes the address and selects the
specified memory location.
Step 3: Memory receives a write command, and the data byte from
the data register is placed on the data bus.
Step 4: Data is stored in the selected memory address.
Outcome: The existing data at that address is overwritten by the
new data byte.
Read Operation
Process:
Step 1: Address code from the address register is placed
on the address bus.
Step 2: Address decoder decodes the address and selects
the specified memory location.
Step 3: Memory receives a read command, and a copy of
the data byte is placed on the data bus.
Step 4: Data byte is loaded into the data register.
Outcome: The data byte remains stored at the original
memory address (nondestructive read).
Random-Access Memory (RAM)
A type of memory where all addresses are accessible in equal time and can be
selected in any order for reading or writing.
Features:
Read and Write Capability: RAM allows both reading from and writing to any memory
location.
Volatility: RAM loses all stored data when power is turned off, making it a volatile
memory.
Usage: Commonly used for temporary data storage during processing.
Read-Only Memory (ROM)
A type of memory where data is stored permanently or semipermanently.
Features:
Read-Only: Data can be read but not written; there is no write operation like in RAM.
Random-Access: Like RAM, ROM is also a random-access memory, but traditionally, RAM
refers to read/write memory.
Nonvolatility: ROM retains stored data even when power is turned off, making it a
nonvolatile memory.
Usage: Used for storing firmware and critical system data that does not change frequently.
Read/Write Memory:
RAM allows data to be both written into and read from any selected address.
Data can be accessed in any sequence.
Write Operation:
When new data is written into a RAM address, it replaces the data previously stored at that
address.
Read Operation:
Reading data from a RAM address does not erase or alter the stored data.
This is known as a nondestructive read, where the content is copied while remaining
intact.
Usage:
RAM is typically used for short-term data storage.
Volatility: RAM cannot retain data once the power is turned off.
Read/Write Memory:
RAM allows data to be both written into and read from any selected address.
Data can be accessed in any sequence.
Write Operation:
When new data is written into a RAM address, it replaces the data previously stored at that
address.
Read Operation:
Reading data from a RAM address does not erase or alter the stored data.
This is known as a nondestructive read, where the content is copied while remaining
intact.
Usage:
RAM is typically used for short-term data storage.
Volatility: RAM cannot retain data once the power is turned off.
Major Categories of RAM:
1. Static RAM (SRAM):
Storage Elements: Uses latches to store data.
Data Retention: Can store data indefinitely as long as DC power is
applied.
Volatility: Loses stored data when DC power is removed.
Speed: Faster data access compared to DRAM.
Types:
Asynchronous SRAM: Operates independently of the system
clock.
Synchronous SRAM with Burst Feature: Operates in sync with
the system clock and allows for fast data bursts.
2. Dynamic RAM (DRAM):
Storage Elements: Uses capacitors to store data.
Data Retention: Cannot retain data for long periods without refreshing
(recharging the capacitors).
Volatility: Loses stored data when DC power is removed.
Capacity and Cost: Can store more data than SRAM for a given physical size and
cost due to simpler cell design.
Types:
Fast Page Mode DRAM (FPM DRAM): Provides fast access to data within a page.
Extended Data Out DRAM (EDO DRAM): Improves data transfer speed by overlapping
operations.
Burst EDO DRAM (BEDO DRAM): Enhances EDO DRAM with burst mode for faster data
transfer.
Synchronous DRAM (SDRAM): Synchronizes with the system clock for improved
performance.
Static RAM (SRAM) Organization and Operation
Memory Cell Array:
SRAM cells are organized in rows and columns.
Each row shares a common Row Select line, while each column connects to data lines that
serve as both input and output (Data I/O).
Write Operation:
A nibble (4 bits) is written into a row by activating the Row Select line and placing data
on the Data I/O lines.
The Write line is activated to store the data in the selected cells.
Read Operation:
The Read line is activated to retrieve the stored data from a selected row, which appears
on the Data I/O lines.
Asynchronous SRAM:
Operates independently of the system clock.
In READ mode, data stored in a selected address appears on the data
output lines.
In WRITE mode, data on the input lines is stored at the selected
address.
•Tri-State Buffers:
Allow data lines to function as either input or output, connected to the
data bus in microprocessor systems.
Outputs can be in three states: HIGH (1), LOW (0), or HIGH-Z (open).
Memory Array Example:
•A 32k × 8 SRAM has 32,768 addresses, each storing 8 bits, totaling 32
kB of memory.
•Address lines are decoded by row and column decoders to access
specific data within the memory array.
Read Operation:
WE (Write Enable) is HIGH.
OE (Output Enable) is LOW.
Input tri-state buffers are disabled; column output buffers are enabled.
Data bits from the selected address appear on the data output lines.
Write Operation:
WE is LOW.
OE is HIGH.
Input tri-state buffers are enabled; output tri-state buffers are disabled.
Data bits on the data lines are written to the selected address.
Read and Write Cycles
•Read Cycle:
•Address applied for read cycle time (tRC).
•CS and OE go LOW; data appears on the data lines after output enable access time (tGQ).
•Write Cycle:
•Address applied for write cycle time (tWC).
•CS and WE go LOW; data is written after address setup time (ts(A)) and held for data hold
time (th(D)).
•Synchronous SRAM:
•Operates with a system clock, synchronizing all operations with clock edges.
•Flow-through SRAM: No data output register; data flows asynchronously.
•Pipelined SRAM: Has a data output register; data flows synchronously.
•Burst Feature:
•Allows reading or writing up to four sequential locations using a single address.
•Address burst logic generates a sequence of internal addresses based on the initial address and
lowest-order address bits.
Definition:
Cache Memory is a small, high-speed memory that stores the most recently used
data or instructions from the larger, slower main memory.
SRAM is commonly used in cache memory due to its speed, although DRAM can
also be used.
Purpose:
To provide faster access to frequently used data and instructions, improving overall
system performance without the high cost of using only fast memory.
Operation:
The cache controller predicts which data or instructions the CPU will need next
and loads them into the cache.
If the prediction is correct, the data is quickly accessible. If incorrect, the CPU has to
access the slower main memory.
•Analogy:
•Cache Memory is like a home refrigerator (cache) that stores frequently used food items for
quick access,
•while the supermarket (main memory) holds all the available food.
•Checking the refrigerator first saves time compared to going to the supermarket.
•Levels of Cache:
•L1 Cache:
•Integrated into the processor chip.
•Very fast but limited in size.
•Known as primary cache.
•L2 Cache:
•May be integrated into the processor or located on a separate chip.
•Larger than L1 cache but slower.
•Known as secondary cache.
•Higher-Level Caches (L3, L4, etc.):
•Some systems include additional caches beyond L1 and L2.
•Disk Cache:
•Used to enhance the performance of hard disks.
•DRAM serves as a cache for slower hard disk drives to speed up data access.
Fast Page Mode:
Concept: Allows rapid access to multiple columns within the same row ("page")
by loading the row address once and then toggling CAS for columns.
Operation:
Initial Addressing: Load row address with RAS active.
Column Access: Use CAS to access columns in the selected row. For a 1024-column
memory, CAS must be activated 1024 times to access all columns in a row.
Refresh Cycles:
Purpose: Prevent data loss due to charge leakage in DRAM capacitors.
Types:
Burst Refresh: Refreshes all rows consecutively at regular intervals (e.g., every 8
ms).
Distributed Refresh: Refreshes each row at intervals between read/write cycles
(e.g., every 7.8 ms).
Refresh Methods:
RAS Only: RAS goes LOW to latch the row address while CAS stays HIGH.
CAS Before RAS: CAS goes LOW before RAS, activating an internal counter for row
Types of DRAM:
Fast Page Mode (FPM): Efficiently accesses multiple
columns in the same row.
Extended Data Out (EDO): Improves speed by keeping
data output active when CAS is not asserted.
Burst Extended Data Out (BEDO): Adds burst
capability, generating multiple addresses from one
external address.
Synchronous DRAM (SDRAM): Synchronizes with the
system clock for improved speed and efficiency.
Double Data Rate SDRAM (DDR SDRAM): Doubles
speed by clocking on both edges of a clock pulse.
•Analogy:
•Cache Memory is like a home refrigerator (cache) that stores frequently used food items for
quick access,
•while the supermarket (main memory) holds all the available food.
•Checking the refrigerator first saves time compared to going to the supermarket.
•Levels of Cache:
•L1 Cache:
•Integrated into the processor chip.
•Very fast but limited in size.
•Known as primary cache.
•L2 Cache:
•May be integrated into the processor or located on a separate chip.
•Larger than L1 cache but slower.
•Known as secondary cache.
•Higher-Level Caches (L3, L4, etc.):
•Some systems include additional caches beyond L1 and L2.
•Disk Cache:
•Used to enhance the performance of hard disks.
•DRAM serves as a cache for slower hard disk drives to speed up data access.
A ROM contains permanently or semi-permanently stored
data.
Can be read from the memory but either cannot be
changed at all or cannot be changed without specialized
equipment.
A ROM stores data that are used repeatedly in system
applications, such as tables, conversions, or programmed
instructions for system initialization and operation.
ROMs retain stored data when the power is off and are
therefore nonvolatile memories.
Mask ROM:
•Data is permanently stored during the manufacturing process.
•Cannot be altered or erased once manufactured.
•Used in applications where the data does not change.
PROM (Programmable ROM):
•Data is electrically stored by the user with specialized equipment.
•Once programmed, it cannot be erased or reprogrammed.
•Available in both MOS (Metal-Oxide-Semiconductor) and bipolar technologies.
EPROM (Erasable Programmable ROM):
Strictly a MOS device.
Data can be erased by exposing the chip to ultraviolet (UV) light for
several minutes.
Can be reprogrammed after erasure.
UV EPROM:
•A type of EPROM that requires UV light for erasing the data.
•Programmed electrically by the user.
•Has largely been replaced by EEPROM.
EEPROM (Electrically Erasable Programmable ROM or
E2PROM):
•Data can be erased electrically in just a few milliseconds.
•Allows both erasing and reprogramming without removing the chip
from the circuit.
•More flexible and convenient compared to UV EPROM, making it
the preferred choice in modern applications.
Complex Internal Organization:
•Most IC ROMs have a more complex
structure than basic examples.
•The complexity is necessary for higher
capacity and efficient data access.
Operation:
When an 8-bit address code (A0 through
A7) is applied, a 4-bit data word appears
on the outputs.
The chip select lines (CS0 and CS1) must
be LOW to enable the output buffers.
This architecture is typical of IC ROMs
with various capacities.
Example of a 1024-bit Device with 256 * 4 Organization:
Logic Symbol:
Shown in Figure 11–27.
When one of 256 binary codes (8 bits) is applied to the address lines, 4 data bits appear on the
outputs if the chip select inputs (CS0 and CS1) are LOW.
256 addresses require 8 address lines.
Voltage Opposition:
The charge on the floating gate acts as a voltage source opposing the control gate voltage.
For a stored '0', this opposition prevents the control gate voltage from reaching the turn-on threshold.
Erase Operation:
Charge Removal:
During erasure, charge is removed from all memory cells.
Voltage Application:
A positive voltage is applied to the transistor source relative to the control gate, opposite
in polarity to the programming operation.
This voltage attracts electrons from the floating gate, depleting it of charge.
Reprogramming:
Flash memory must be erased before it can be reprogrammed.
Array Access:
The simplified array structure shows that only one row line is accessed at a time.
Storage Capacity:
USB flash drives are rewritable and have storage capacities ranging up to 512 GB, with common capacities
ranging from 2 GB to 64 GB.
Storage capacities are constantly increasing as technology advances.
USB Icon:
The USB icon, often found on devices and ports, indicates the connection point for USB devices.