# Lecture 6: The Walls to Sequential Computing. Moore’s Law.

## Lecture Summary

* Wrap up Caches
* Virtual Memory

## Caches

![](/files/-MT4Gz0D9R0lC7yJDhbe)

* Handling a write-hit
  * Write-through
  * Write-back
* Handling a write-miss
  * Write-allocate
  * No-write-allocate
* Typical combos in practice
  * Write-back + Write-allocate (more common)
  * Write-through + No-write-allocate

Miss rate is more important than the hit rate: 97% hit rate is \~2 times worse than 99% hit rate

![Cache Capacity Effects from Memory Mountain](/files/-MT4NLNO8skPv67NM0ir)

## Case Study: Rearranging Loops to Improve Spatial Locality

## Virtual Memory

Why memory virtualization?

* Ease of use (running programs that require more memory than physically available)&#x20;

* Isolation (running multiple programs simultaneously)

* Protection

* A page of virtual memory corresponds to a frame of physical memory

* Page table enables the translation of virtual address into physical addresses

* The page table is stored in main memory
  * If the page table is accessed for each address translation, this would be very costly

* Translation Lookaside Buffer (TLB): "Cache" for the addr translation process

![](/files/-MT4TqtQ-6GaZW2HvDkn)

![](/files/-MT4TyJfcTfwIFBPdeA3)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.ruipan.xyz/earlier-readings-and-notes/cs759-hpc-course-notes/lecture-6-the-walls-to-sequential-computing.-moores-law..md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
