2075 6

CSC114 ยท 2075 ยท 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. Speed Bridging: The CPU operates much faster than RAM (CPU registers: 1-2 ns, RAM: ~60 ns). Cache memory (speed: 2-10 ns) bridges this speed gap so the CPU does not have to wait for data from the slower main memory.

  2. Temporary Storage of Active Data: Cache holds the currently working data and instructions that the CPU is likely to need next, reducing the number of times the CPU must access the slower main memory.

  3. Performance Improvement: By keeping frequently used data close to the CPU, cache memory significantly speeds up overall system performance.

Key Characteristics of Cache Memory:

  • Speed: 2 to 10 nanoseconds
  • Size: 32 KB to 4 MB
  • Made of SRAM (Static RAM) which uses 4-6 transistors per cell, requires no refreshing, and is faster than DRAM
  • Volatile memory (data is lost when power is off)
  • Directly accessible by the CPU

Sequential Access vs. Direct Access

These are two different methods of accessing information stored in a file or storage device.

FeatureSequential AccessDirect Access
DefinitionData is accessed in a sequential order from start to endData can be accessed in any order, directly at any location
OrderMust read all preceding records before reaching the desired oneCan jump directly to the required record
SpeedSlower for retrieving a specific recordFaster for retrieving a specific record
ExampleReading a tape from beginningReading a specific block on a hard disk
FlexibilityLess flexibleMore flexible

Summary:

  • Sequential access means the file is read from the beginning to the end in order; you cannot skip to a specific location without passing through all previous data.
  • Direct access means any part of the file can be read or written at any time without going through the preceding data, making it much more efficient for random retrieval.

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