0 6

CSC114 ยท 0 ยท 5 marks

What is the purpose of cache memory? How sequential access differs from direct access?

What is the purpose of cache memory? How sequential access differs from direct access? [5]

Introduction to Information TechnologyChapter 3: Computer MemoryCache Memory

Quick answer

Cache memory is a small, high-speed memory placed between the CPU and the main memory (RAM) in the memory hierarchy.

Cache Memory and Access Methods

Purpose of Cache Memory

Key Purposes:

  1. Bridge the Speed Gap: The CPU operates much faster than RAM (CPU registers: 1-2 ns, RAM: ~60 ns). Cache (2-10 ns) sits between them and reduces the time the CPU spends waiting for data.

  2. Holds Currently Working Data and Instructions: Cache stores the data and instructions that the CPU is actively using or is likely to use very soon, so the CPU does not have to fetch them repeatedly from the slower main memory.

  3. Improves Overall System Performance: By providing fast access to frequently used data, cache reduces the number of slow memory accesses and speeds up program execution.

  4. Temporary Storage: Cache is volatile memory (lost when powered off) and has limited capacity (32 KB to 4 MB), but its high speed (made of SRAM with access speed 2-10 ns) makes it ideal for this role.

In summary: Cache memory acts as a fast buffer that keeps the CPU supplied with data quickly, minimizing bottlenecks caused by slower main memory.


Sequential Access vs. Direct Access

FeatureSequential AccessDirect Access
DefinitionData is accessed in a sequential order from start to endData can be accessed in any order, directly at any location
Order of AccessMust go through all preceding records to reach a target recordCan jump directly to the required record
SpeedSlower, especially for records near the endFaster, as any record is reachable immediately
ExampleMagnetic tapeHard disk, RAM
Use CaseReading a file from beginning to endSearching or updating a specific record

Brief Explanation:

  • Sequential Access: The file or data is read in a fixed order, from the beginning to the end. To reach a particular piece of data, all the data before it must be read first. This is like rewinding and playing a cassette tape.

  • Direct Access: The file or data can be accessed at any point without going through the preceding data. The system can directly locate and read/write any record. This is like jumping to any track on a CD.

As stated in the notes: "The access in a sequential order from start to end is called sequential access and the file that is accessed in any order is called direct access."

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.