Describe the three techniques used for mapping blocks of memory into cache lines

1. Direct mapping: In this technique, each block of memory is assigned to a specific cache line based on a formula that uses the memory address of the block. This formula ensures that each block maps to a unique cache line. Direct mapping is simple and efficient, but it may lead to cache conflicts if multiple blocks map to the same cache line.

2. Associative mapping: In this technique, each block of memory can be mapped to any cache line in the cache. This allows for more flexibility in mapping, as each block can be placed in any available cache line. However, associative mapping can be more complex and may require additional hardware to support the mapping.

3. Set-associative mapping: This technique is a compromise between direct mapping and associative mapping. In set-associative mapping, each block of memory is mapped to a specific set of cache lines, rather than a single cache line. Within each set, the block can be placed in any available cache line. This helps reduce cache conflicts compared to direct mapping while still providing some flexibility in mapping compared to fully associative mapping.