6. Computer Memory RAM, ROM, Cache Memory, Virtual Memory, Secondary Storage Devices,
Computer memory refers to the storage space inside a computer where data, instructions, and programs are stored so that the processor can access them when needed.
Memory plays a critical role in the functioning of a computer because the CPU can only process data that is available in memory. When a program is executed, it is first loaded into memory, and then the CPU performs operations on that data.
Computer memory is generally divided into two main categories:
Primary memory is directly accessed by the CPU, while secondary storage is used for long-term data storage.
Random Access Memory (RAM) is a type of primary memory used to store data and programs that are currently being used by the computer.
It is called random access because any memory location can be accessed directly without going through other memory locations.
Volatile Memory
RAM is volatile, which means the data stored in RAM is lost when the computer is turned off.
Fast Access Speed
RAM provides very fast access to data compared to secondary storage devices such as hard drives.
Temporary Storage
It stores data temporarily while programs are running.
Direct CPU Access
The CPU directly reads from and writes to RAM during processing.
DRAM stores each bit of data in a capacitor and needs to be refreshed constantly to maintain the stored information.
Characteristics:
SRAM stores data using flip-flop circuits, which means it does not need constant refreshing.
Characteristics:
RAM significantly affects a computer’s performance because:
Read Only Memory (ROM) is a type of non-volatile memory used to store permanent instructions required for starting and operating the computer.
Unlike RAM, data in ROM remains stored even when the computer is powered off.
ROM typically stores firmware, which is software permanently embedded in hardware devices.
Non-Volatile Memory
Data is not lost when power is turned off.
Permanent Storage
Information is written once and rarely changed.
Used for Booting
ROM contains instructions required to start the computer system.
PROM is a type of ROM that can be programmed once after manufacturing.
Once programmed, the data cannot be changed.
EPROM can be erased using ultraviolet light and then reprogrammed again.
EEPROM can be erased and rewritten using electrical signals without removing it from the computer.
Modern computers commonly use EEPROM or Flash memory.
Cache memory is a very small but extremely fast memory located close to or inside the CPU.
It is used to store frequently accessed data and instructions so that the CPU can retrieve them quickly.
Cache memory improves system performance by reducing the time needed for the CPU to access data from the main memory.
Instead of repeatedly accessing RAM, the CPU first checks whether the required data is available in the cache.
If the data is found in cache memory, it can be accessed much faster.
Very High Speed
Cache memory is faster than both RAM and secondary storage.
Small Size
Cache memory is much smaller compared to main memory.
Expensive
Because of its speed, cache memory is more expensive to manufacture.
Virtual memory is a memory management technique that allows a computer to use part of the secondary storage as if it were RAM.
It enables the system to run programs that require more memory than the physically available RAM.
When RAM becomes full, the operating system temporarily transfers some data from RAM to a section of the hard disk called the paging file or swap space.
When that data is needed again, it is moved back into RAM.
This process is known as paging.
Allows Running Large Programs
Programs larger than the available RAM can still run.
Improves Multitasking
Multiple programs can run simultaneously.
Efficient Memory Management
The operating system can manage memory resources more effectively.
Slower Performance
Since hard drives are much slower than RAM, accessing data from virtual memory reduces system speed.
Increased Disk Usage
Frequent swapping between RAM and disk may affect performance.
Secondary storage devices are used to store data permanently in a computer system.
Unlike RAM, data stored in secondary storage remains even when the computer is turned off.
These devices are used for storing:
Non-Volatile
Data is preserved without power.
Large Storage Capacity
Secondary storage can store large amounts of data.
Slower than Primary Memory
Access speed is slower compared to RAM.
A Hard Disk Drive stores data on magnetic disks called platters.
Characteristics:
A Solid State Drive stores data using flash memory chips instead of moving parts.
Characteristics:
Optical devices store data using laser technology.
Examples include:
These devices are commonly used for media distribution and data backup.
A USB flash drive is a portable storage device that uses flash memory and connects to a computer via a USB port.
Characteristics:
Memory cards are small storage devices commonly used in:
Examples include:
Computer memory is a crucial component of a computer system because it enables the storage and retrieval of data required for processing. Different types of memory such as RAM, ROM, cache memory, virtual memory, and secondary storage devices work together to ensure that the computer system operates efficiently and can store both temporary and permanent information.