Computer Architecture Drills
The procedures, until they are fast
CS203 teaches each of these once, against one example, and moves on. This is the volume — thirty-three procedures from De Morgan to Amdahl’s law, on RISC-V, with questions generated fresh that never run out. Each stays green only while your recent answers hold.
- Modules
- 9
- Drills
- 33
- Build steps
- 0
- Time
- ~6h
Walk out able to
Split a cache address, count a pipeline’s stalls, and compute an $\text{AMAT}$ — without stopping to rebuild the rule first.
What you drill
Gates, maps and wrapping
Boolean laws, canonical forms, K-maps, overflow flags.
RV32I, and the machine
Formats, fields, addresses, frames, control words.
Clocks and pipelines
State tables, critical paths, CPI, hazards, prediction.
Memory, near and far
Index and tag, AMAT, page walks, TLB reach, Amdahl.
The pitch
What you practise, and what you leave with
Not an artifact — a set of reflexes. Thirty-three procedures that are each either current or not, and a rail that says which.
You will practise
- Boolean laws, K-maps, two’s complement
- RV32I formats, addresses and the ABI
- Control words, clock periods, pipelines
- Caches, page tables and Amdahl’s law
Afterwards you can
- Split an address into tag, index, offset
- Count the stalls a sequence really costs
- Decode an RV32I word field by field
- Compute an AMAT across two levels
Modules
9 modules, 34 items
Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.
- 1
Read a circuit
~37 minPush a complement through a gate, read a canonical form, and cover a map minimally.
- LessonWhat this project is for4 min
- DrillShorten it by one law10 min
- DrillCount a canonical form9 min
- DrillCover a Karnaugh map14 min
- 2
Arithmetic that wraps
~28 minRead a signed pattern, say what a fixed-width add stores, and tell the two flags apart.
- DrillRead a two’s-complement pattern8 min
- DrillSay what the machine stores10 min
- DrillTell a carry from an overflow10 min
- 3
Controllers and datapaths
~30 minWalk a transition table, size a state register, and read simultaneous transfers.
- DrillWalk a state-transition table13 min
- DrillSize a register or a mux8 min
- DrillRead simultaneous transfers9 min
- 4
The RV32I contract
~40 minName a format, decode a field, form an address, and extend a narrow load.
- DrillName the instruction format8 min
- DrillDecode a field from the word12 min
- DrillForm an effective address10 min
- DrillExtend a narrow load10 min
- 5
Assembly and the ABI
~38 minPlace a value in the right register, size a frame, shift, mask, and lay out a struct.
- DrillPlace a value in a register8 min
- DrillSize and fill a stack frame10 min
- DrillShift and mask8 min
- DrillLay out a struct in memory12 min
- 6
Building the processor
~34 minState a control word, turn block delays into a clock period, and price an instruction mix.
- DrillState the control word9 min
- DrillTurn delays into a clock period13 min
- DrillPrice an instruction mix12 min
- 7
Keeping the pipeline full
~44 minCount cycles and stalls, find the hazards, and price a branch that guessed wrong.
- DrillCount cycles through a pipeline9 min
- DrillFind the hazards in a sequence14 min
- DrillPrice a mispredicted branch9 min
- DrillTrace a 2-bit predictor12 min
- 8
The memory hierarchy
~46 minSplit an address, classify a miss, price a write policy, and average an access.
- DrillSplit an address three ways12 min
- DrillClassify a miss9 min
- DrillPrice a write policy12 min
- DrillAverage a memory access13 min
- 9
Translation, and its limits
~52 minSplit a virtual address, reach of a TLB, what an access does, and Amdahl’s ceiling.
- DrillSplit a virtual address11 min
- DrillWork out a TLB’s reach9 min
- DrillName what an access does10 min
- DrillClassify a dependence10 min
- DrillApply Amdahl’s law12 min
More in Algorithms & interviews
Keep going
Discrete Mathematics Drills
MA101 taught it once. This is the volume.
Intermediate~8h8 modules
Interview: Two Pointers & Sliding Window
Read the problem. Then say whether a window applies at all.
Intermediate~3h4 modules
Interview: Trees & Graphs
One skeleton. Then the family it answers.
Intermediate~5h6 modules
Interview: Dynamic Programming
Most problems are not new. Learn to see the shape.
Advanced~5h5 modules
CS203 taught it once. This is the volume.
The first item is free. ~6h of focused work, at your own pace.
Advanced~6h9 modules