Instruction execution and datapath
Each instruction goes through fetch, decode, execute, memory access, and writeback stages. The cycle time of a single-cycle processor equals the slowest instruction's total delay. A multi-cycle design lets different instructions take different numbers of cycles.
Check yourself: Which stages does the current instruction actually use?
Pipelining and hazards
Pipelining overlaps stages of consecutive instructions. Data hazards occur when an instruction needs a result not yet written back. Forwarding can resolve some hazards without stalling. Control hazards from branches may require flushing, prediction, or delayed branching. Pipeline speedup approaches the number of stages only for long instruction streams.
Check yourself: Does forwarding resolve this hazard, or is a stall still required?
Cache organization
A cache with 2^s sets and associativity A holds A × 2^s blocks. An address splits into tag, set index, and block offset fields. A direct-mapped cache (A = 1) has no placement choice within a set; fully associative has one set. Conflict misses occur only when A < total blocks.
Check yourself: How many bits are in the offset, index, and tag fields?
Cache performance
Average memory access time = hit time + miss rate × miss penalty. Compulsory misses occur on the first access to a block. Capacity misses occur when the working set exceeds cache size. Increasing associativity reduces conflict misses but may increase hit time.
Check yourself: Are you using the local miss rate or the global miss rate for multi-level caches?
Virtual memory and I/O
Virtual memory translates virtual addresses to physical frames through page tables. TLBs cache recent translations. Page faults service from disk, so their penalty is orders of magnitude larger than a cache miss. I/O can be memory-mapped or port-based; DMA transfers data without CPU intervention per word.
Check yourself: Is the page in physical memory, or does this access cause a page fault?