Direct-Mapped Cache as a Set-Associative Cache Origin (n Blocks)

Direct-Mapped Cache as a Set-Associative Cache Origin (n Blocks)

Verified Sources
Nov 4, 2026

A direct-mapped cache is a special case of a set-associative cache in which each memory block can map to exactly one cache line (no “choice” among multiple ways). In set-associative terms, that means there is exactly one way per set, i.e., it is 1-way set associative.2

A direct-mapped cache with nn cache blocks can be viewed as having nn sets, each set containing 1 line (1 way). Therefore, among the provided options, the correct originations are:

  • (ii) 1-way set associative

Key terms:

  • direct-mapped cache
  • set-associative cache
  • associativity (ways)
  • cache set

Footnotes

  1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

  2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

Direct-Mapped vs Set-Associative Cache (intuitive explanation)

How associativity maps to direct-mapped behavior

  1. 1
    Step 1

    In a set-associative cache, the address selects a cache set using the index bits, and then the block can go into any of the lines in that set (the “ways”).2

    Footnotes

    1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

    2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

  2. 2
    Step 2

    Direct-mapped means each memory block maps to exactly one cache line, so within the selected set there is no alternative choice.2

    Footnotes

    1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

    2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

  3. 3
    Step 3

    If each set contains exactly one line, then there is exactly 1 way per set, i.e., the cache is 1-way set associative.2

    Footnotes

    1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

    2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

  4. 4
    Step 4

    Having nn cache blocks implies nn total cache lines; under direct-mapped mapping each line forms its own set with 1 way, matching the 1-way set associative characterization.

    Footnotes

    1. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

Multiple-choice clarification

Pro Tip

When you see direct-mapped, immediately translate it to “one way per set”. That’s the quickest route to the correct option.

Common confusion: interpreting “n blocks”

The phrase “with nn blocks” can tempt you to think associativity might be nn-way. Associativity (ways) is the number of lines within one set, not the total number of cache lines/blocks. For direct-mapped, ways = 1 regardless of how many total blocks you have.2

Footnotes

  1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

  2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

Associativity in set-associative cache families

Direct-mapped corresponds to 1-way.

From mapping rule to the set-associative classification

Direct-mapped mapping

Rule: single location

Each memory block maps to exactly one cache line.2"

Footnotes

  1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

  2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

Within-set alternatives = 1

Set selected, then no choice

Selected set contains exactly one line that can receive the block.2"

Footnotes

  1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

  2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

Associativity

Ways count

Associativity = 1 → 1-way set associative.2"

Footnotes

  1. Set-associative cache (Wikipedia) - Explains set-associative structure and the concept of multiple ways per set. ↩

  2. Direct-mapped cache (Wikipedia) - Describes direct-mapped mapping as a special case with one cache line per memory block, consistent with 1-way set associativity. ↩

Knowledge Check

Question 1 of 3
Q1Single choice

A direct-mapped cache is equivalent to which set-associative cache configuration?