2.1 - Primary Storage (RAM & ROM)
The role of memory in computers
Memory is essential in computers as it stores the instructions that the central processing unit (CPU) follows to perform tasks. Without memory, a computer could not operate because it would lack the data and programs needed for processing.
Key types of memory:
- Random access memory (RAM) - This is the main memory used for temporary storage of data and programs while they are in use.
- Read only memory (ROM) - This holds permanent instructions that cannot be changed easily.
- Virtual memory - This acts as an extension of RAM by using space on secondary storage.
Memory can be classified based on whether it retains data without power:
Memory classification:
- Volatile memory - Temporary storage that loses its contents when power is removed, such as RAM.
- Non-volatile memory - Permanent storage that keeps data even without power, such as ROM or secondary storage like solid state drives (SSDs) or hard disk drives (HDDs).
Characteristics and function of RAM
RAM serves as the computer's main memory, allowing quick access to data and programs during operation. It is volatile, meaning it requires constant power to hold information, and data is lost when the computer is turned off.
How RAM is used in a computer:
- When the computer starts (boots up), the operating system (OS) is copied from secondary storage into RAM.
- Opening applications, documents, or files copies them from secondary storage to RAM for active use, where they remain until closed.
- RAM enables multitasking by holding multiple programs and data sets simultaneously, providing fast access for the CPU.
Speed comparison of RAM:
- RAM is faster than secondary storage, making it ideal for active tasks.
- However, it is slower than the CPU cache, which is a smaller, high-speed memory inside the CPU for frequently used data.
RAM's speed supports efficient processing, but its limited capacity can lead to performance issues if overloaded.
Virtual memory and its impact on performance
Virtual memory extends RAM by using a portion of secondary storage as temporary extra memory. This becomes necessary when physical RAM is full, allowing the computer to continue running applications.
When and why virtual memory is used:
- Computers have a fixed amount of RAM, which fills as more applications open or when using memory-intensive programs.
- Data not recently used is moved from RAM to virtual memory on secondary storage to free up space.
- This is common with many open applications or programs requiring large amounts of data, such as video editing software.
Process of using virtual memory:
- When physical RAM is full, the OS identifies and moves inactive data to virtual memory on secondary storage.
- If the CPU requires this data, it is retrieved and swapped back into RAM.
- This continuous movement of data between RAM and virtual memory is known as swapping.
Effects on computer performance:
- Slow data access - Secondary storage has slower transfer rates than RAM, so accessing virtual memory takes longer.
- Reduced responsiveness - Switching between applications may cause delays while data is swapped.
- Overall slowdown - Constant swapping in memory-intensive tasks can make the system feel sluggish, as the computer waits for data to move.
Using virtual memory prevents crashes but can degrade performance, so increasing physical RAM is often a better solution for heavy users.
ROM and the boot-up process
ROM is non-volatile memory that stores permanent instructions and can only be read, not written to by normal operations. It is built into a small chip on the motherboard.
Key features of ROM:
- It retains data without power, ensuring essential instructions are always available.
- ROM contains the basic input output system (BIOS), which is a type of firmware - software embedded in hardware for specific device control.
- Although read-only, ROM can sometimes be updated through a process called flashing to install new BIOS versions.
Embedded systems, which are specialised computers in devices like microwaves, are often controlled by firmware similar to BIOS.
How ROM enables boot-up:
- When the computer is powered on, the CPU immediately reads instructions from ROM.
- These instructions direct the CPU to run self-checks, such as testing if memory works and detecting connected hardware.
- The BIOS then copies the OS from secondary storage into RAM.
- Once loaded, the OS takes over, allowing the user to interact with the computer.
This process ensures the computer starts reliably and sets up all necessary components before normal operation begins.