CPUのキャッシュメモリに関する記述のうち, 適切なものはどれか。
平成26年度 春期 ITパスポート試験 問65
This question's explanation and your answers so far.
問 65
Incorrectア
The speed relationship is reversed. The L1 cache is closest to the CPU and is the level accessed first, so it uses memory that is “faster” than the L2 cache. Correspondingly, its capacity is smaller than that of the L2 cache. This statement contradicts the memory hierarchy principle that levels closer to the CPU are faster with smaller capacity, while more distant levels are slower with larger capacity.
Incorrectイ
The explanation that the L1 and L2 caches serve different purposes is wrong. Both have the same purpose of reducing the number of accesses to main memory and thereby speeding up CPU processing; they are levels of one hierarchy that differ only in capacity and speed. Speeding up image rendering is the job of the GPU (a processor dedicated to image processing) and video memory (VRAM), not of the L2 cache.
- ウ
正解 The correct answer is ウ. Cache memory is a small, high-speed memory placed between the fast CPU and the slow main memory in order to bridge the speed gap between them. In today's CPUs it is not a single level; starting from the side closest to the CPU core, it is built as a hierarchy (a memory hierarchy) of an L1 cache, an L2 cache, and so on. When the CPU reads data, it first searches the nearest and fastest L1 cache, and if the target data is there (a hit), it uses it. If the data is not in the L1 cache (a miss), it next searches the L2 cache, and if it is not there either, it accesses main memory — descending in this order to lower levels of storage. ウ describes exactly this order of reference, so it is appropriate. It is also worth remembering the relationship that levels closer to the CPU are faster but smaller in capacity, while more distant levels are slower but larger in capacity.
Incorrectエ
The first half, “the L1 cache is used to speed up access to main memory,” is correct, but the second half is wrong. Virtual memory is an OS mechanism that uses part of auxiliary storage (a hard disk or an SSD) in place of main memory so that an address space larger than main memory can be handled; it has nothing to do with the L2 cache. The L2 cache, too, is nothing more than a level for speeding up access to main memory.
- Cache memory is a fast, small-capacity memory that bridges the speed gap between the CPU and main memory. A reference starts at the L1 cache nearest the CPU; on a miss it moves to the L2 cache, and then down to main memory.
- The principle of the memory hierarchy: levels closer to the CPU are faster but smaller in capacity, while more distant levels are slower but larger in capacity. Also distinguish it from virtual memory (an OS mechanism that supplements main memory using auxiliary storage) and from the GPU/VRAM (image rendering), which have different purposes.