> For the complete documentation index, see [llms.txt](https://isubasinghe.gitbook.io/isithas-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://isubasinghe.gitbook.io/isithas-wiki/computer_science/computer_architecture.md).

# computer architecture

## Basic idea

Computer architecture connects instruction-set semantics to processor organization and performance. It covers pipelines, execution units, registers, caches, virtual memory, coherence, interconnects, accelerators, and the hardware/software contract.

## Key formulas

* CPU time: $T=\text{instructions}\times\mathrm{CPI}\times\text{cycle time}$.
* Speedup: $S=T\_{old}/T\_{new}$.
* Average memory access time: $AMAT=t\_{hit}+r\_{miss}p\_{miss}$.
* Little's law: concurrency $=\text{throughput}\times\text{latency}$.
* Amdahl's law bounds gains from accelerating only part of a workload.
* DMA transfers data between devices and memory; IOMMUs translate and isolate device accesses.
* LRU has the stack property, so increasing a fully associative LRU cache cannot increase misses.
