The electronic holding place for the instructions and data a computer needs to reach quickly and where information is stored for immediate use
One of the basic functions of a computer, because without it, a computer would not be able to function properly
Computer memory is used by a computer's operating system, hardware and software
Virtual Address
An address that is used by the operating system and the applications running on it to access memory. A virtual address is a logical address that is mapped to a physical address in the computer's memory.
Virtual Memory
1. Operating system divides the memory into pages
2. Each page is assigned a unique virtual address
3. When an application accesses memory, it uses virtual addresses
4. Operating system translates these virtual addresses into physical addresses
Virtual Memory
Allows multiple applications to share the same physical memory
Ensures each application can only access its own virtual address space, preventing one application from accessing the memory of another
Allows applications to use more memory than is physically available by swapping out data from memory to disk when it's not needed and swapping it back in when it is needed again
Memory
Meets temporarydata access needs
Storage
Retains data and other files over the long term
Types of Computer Memory
Cache Memory
RAM
Dynamic RAM (DRAM)
Static RAM (SRAM)
Double Data Rate SDRAM
Double Data Rate 4 Synchronous Dynamic RAM
Rambus Dynamic RAM
Read-Only Memory (ROM)
Programmable ROM (PROM)
Erasable PROM (EPROM)
Electrically Erasable PROM (EEPROM)
Virtual Memory (VM)
Cache Memory
A chip-based computer component that makes retrieving data from the computer's memory more efficient
Cache Memory
Acts as a temporary storage area that the computer's processor can retrieve data from easily
Designed to store data and programs that are frequently accessed by the central processing unit (CPU), enabling data and programs to be delivered to the computer more quickly than via standard RAM
Despite being faster than RAM, memory cache is slower than a CPU cache, primarily because it is not in close proximity to the processor
Cache Memory Operation
1. CPU checks if the information it needs is stored in the cache
2. If it is, the cache returns the data to the CPU
3. If the information is not in the cache, the CPU retrieves it from the main memory
4. Disk cache memory operates similarly, but the cache is used to hold data that have recently been written on, or retrieved from, a magnetic disk or other external storage device
Memory Address
An ID used to denote a discrete byte-sized section of memory
Processors interact with their respective memory pool by reading and writing bytes/words of memory
Over the years, processors have been getting faster and faster as technology has progressed but memory hasn't kept pace
There is now a significant gap in performance between CPUs and RAM: this gap has gotten so large that a single memory access can take hundreds of CPU cycles to occur
Cache Hit
When the cache contains the data the processor wants to access
Cache Miss
When the cache doesn't contain the relevant data the processor wants to access
Cache Hit-Rate
The ratio of cache hits to misses, indicating how often the cache contains the data the processor wants
Increasing cache size will make a cache more accurate, but there's a tradeoff - when you increase the size of your cache, you also slow it down. Doubling the size of the cache results in a 1.41x increase in latency
Latency
The time delay between initiating a request for a byte or word in memory until it is retrieved by a processor
Computing Cache Hit-Rate
1. Hit-rate = Number of cache hits / Total number of cache accesses
2. Number of cache misses = Total number of cache accesses - Number of cache hits
External Cache
Cache memory that is not built into a CPU chip, designed to provide high speed data storage and processing services to the computer processor, its primary/native cache and the main memory
Internal Cache Memory
Memory area located inside of the CPU, also referred to as the L1 cache. This type of memory is faster than the external cache memory
Cache Memories from closest to core to closest to memory
L1
L2
L3
L4
L1 Cache
Very fast, matter of few cycles to fetch data, uses bigger transistors and is small in size, most x86 CPUs have 64kB, usually separate for instructions (L1I) and data (L1D)
L2 Cache
Slower than L1 but much bigger, x86 usually in range of 512kB, accessed after L1 cache, serves the CPU with less frequently used data in comparison to L1 but still more frequently used than DRAM data
L3 Cache
Slowest memory, always shared among cores, available in x86 and some mobile CPUs
L4 Cache
Used some time ago by Intel, shared between CPU and GPU, 64 - 128MB in size, not used any more in consumer but available on workstations. Some mobile chips use DDR as L3 cache and share it between CPU and GPU
L0 Cache
Used for caching micro Ops after being decoded to eliminate decoding cycle, depends on architecture
TLB
Cache for address translation - Translation Lookaside Buffer. Instead of searching translation pages in RAM last used translations are cached in TLB
Generally, the more cache the better. The less the CPU needs to access DRAM, the faster it can calculate data.
Random Access Memory (RAM)
A computer's short term memory. A small amount of data can be stored here to be accessed quickly when the processor needs it. Unlike internal SSD or HDD, RAM only stores data temporarily and resets when the computer is rebooted.
RAM is essential in any computer. Without it, everything would run much slower since the processor would have to constantly access slower storage devices.
DDR
Double Data Rate - the most commonly used RAM on the planet, synchronized to the memory clock just like SDRAM
RDRAM
Faster data transfer rates up to 800 MHz compared to SDRAM/DDR SDRAM
16-bit data path compared to 64-bit for SDRAM/DDR SDRAM
Theoretical maximum bandwidth of 1.6GB/sec same as PC1600 DDR SDRAM
SIMM
Single inline memory module - considered obsolete now, used in 1980s-1990s, 32-bit data transfer
DIMM
Dual inline memory module - commonly used now, 64-bit data transfer
DRAM package types for DIMMs
Unbuffered DIMMs (UDIMMs)
Registered DIMMs (RDIMMs)
Fully buffered DIMMs (FB-DIMMs)
PROM
Programmable read-only memory - contents can be changed once after manufacture, then permanently fixed