Computer Organization: Worked Examples
Work through each trace before reading the explanation. Then solve the transfer task without the page open.
Example 1: Stride changes useful work per cache line
Assume 64-byte cache lines and four-byte integers. A sequential scan can consume 16 integers per fetched line. A stride of 16 integers uses only one integer from each fetched line in a cold, aligned scan.
Both algorithms can make the same number of arithmetic operations but move different amounts of useful data per line. Prefetching, cache capacity, associativity, and alignment complicate actual timing, so this is a traffic model rather than a promised speed ratio.
Example 2: Speeding one part has a hard limit
A program spends 40% of time in an optimizable kernel and 60% elsewhere. Making the kernel four times faster gives overall speedup 1/(0.6+0.4/4)=1.4286.
Even an infinitely fast kernel only reaches 1/0.6=1.6667. Optimizing a visually complicated function without measuring its time share can therefore have little impact. The calculation assumes the workload and other costs remain unchanged.
Transfer and self-check
If 90% is parallelizable across 8 ideal workers, what is the modeled speedup? Check: 1/(0.1+0.9/8), approximately 4.706, before coordination costs.
Evidence to keep
Save your first attempt, corrected reasoning, and transfer result as checkpoint evidence. A matching final answer without an explanation is insufficient. Continue with the guided lab and use the reading guide to repair a specific gap.