TactivergeLite

Lite / Independent Engineering Research / Term 3 worksheet

Worksheet: Independent Engineering Research, term 3

Advanced Computing and System Design · Questions only. Check your answers in each Lite lesson, where they are graded on our server.

Name:   Date:

Week 19: How fast does the work grow?

1. How many times is work() called when n = 16? Code: i = n; while i > 1: { work(); i = floor(i / 2) }

Answer: calls

2. Which is the tightest description of f(n) = 4n³ + 200n² log n + 10⁶?

3. A braking controller must finish its computation within 2 ms every cycle. Which complexity matters most?

4. How many times is work() called when n = 270? Code: for i in 0 … n−1: for j in i+1 … n−1: work()

Answer: calls

5. An n³ algorithm handles n = 200 in one second. The machine is replaced with one 8 times faster. What n now fits in one second?

Answer:

6. Merge sort (Θ(n log n) time, Θ(n) extra space) and heapsort (Θ(n log n) time, Θ(1) extra space) must sort 40 KB of samples on a chip with 48 KB of free RAM. Which is safer?

Check these in the lesson

Week 19: Divide, conquer and count with recurrences

1. T(n) = 3·T(n/2) + n for n > 1, with T(1) = 1. What is T(32)?

Answer:

2. An algorithm checks the middle of a sorted array, then recurses on one half. Which recurrence describes it?

3. T(n) = 2·T(n/2) + 1 for n > 1, with T(1) = 1. What is T(32)?

Answer:

4. For T(n) = 8T(n/2) + n², which part of the recursion tree dominates?

5. Quicksort's worst case gives T(n) = T(n − 1) + n with T(1) = 1. What is T(10)?

Answer:

Check these in the lesson

Week 19: When exact answers are out of reach

1. Which statement captures membership of NP?

2. How many distinct round trips (direction ignored) through 8 cities?

Answer:

3. Your greedy scheduler beats random scheduling on every test. What should the report claim?

4. How many times is work() called when n = 270? Code: for i in 0 … n−1: for j in i+1 … n−1: work()

Answer: calls

5. Which problem has a known polynomial-time algorithm?

Check these in the lesson

Week 20: Single-cycle, multi-cycle and the Iron Law

1. A program executes 750 million instructions with an average CPI of 0.8 on a 2 GHz processor. How long does it take, in milliseconds?

Answer: ms

2. A program's mix is 60% ALU (1 cycle), 15% loads (2 cycles), 20% branches (3 cycles) and 5% stores (2 cycles). What is the average CPI?

Answer:

3. A compiler optimisation removes redundant instructions without changing the hardware. Which Iron Law factor does it change most directly?

4. A program executes 200 million instructions with an average CPI of 1.8 on a 3 GHz processor. How long does it take, in milliseconds?

Answer: ms

5. Design A: CPI 1.6 at 3 GHz. Design B: CPI 1.0 at 2.4 GHz, same instruction count. What is B's speed-up over A?

Answer: ×

Check these in the lesson

Week 20: Pipelining: an assembly line for instructions

1. 127 instructions run on a 4-stage pipeline. Hazards insert 6 stall cycles in total. How many clock cycles until the last instruction completes?

Answer: cycles

2. A single-cycle datapath has a 5 ns cycle. It is split into 10 equal stages, each adding 0.1 ns of register (latch) overhead. What is the speed-up for 100 instructions with no stalls?

Answer: ×

3. Compared with the unpipelined design, the latency of a single instruction in a pipeline is…

4. 83 instructions run on a 8-stage pipeline. Hazards insert 9 stall cycles in total. How many clock cycles until the last instruction completes?

Answer: cycles

5. A 1,200 ps datapath is split into 6 perfectly balanced stages with 50 ps register overhead each. What is the speed-up limit for very long programs?

Answer: ×

Check these in the lesson

Week 20: Hazards, forwarding and branch prediction

1. lw r5, 4(r2) / add r6, r5, r1. Which hazard and, with forwarding, how many stall cycles?

2. A pipeline has base CPI 1. Branches are 15% of instructions, 20% of them are mispredicted, costing 2 cycles each. Loads and stores are 20% of instructions, 10% of them miss in the cache, costing 100 cycles each. What is the effective CPI?

Answer:

3. Design B doubles the pipeline depth of A, raising the clock 1.6× and the branch penalty from 2 to 5 cycles. Branch fraction 20%, mispredict 10%, base CPI 1 for both, memory ignored. Which is faster?

4. A pipeline has base CPI 1. Branches are 20% of instructions, 10% of them are mispredicted, costing 15 cycles each. Loads and stores are 35% of instructions, 4% of them miss in the cache, costing 50 cycles each. What is the effective CPI?

Answer:

5. On the classic 5-stage pipeline with no forwarding, a chain of 4 ALU instructions each uses the previous one's result. How many total cycles? (Ideal is 8.)

Answer: cycles

6. Why do most processors have separate L1 instruction and data caches?

Check these in the lesson

Week 21: Locality and the memory hierarchy

1. A filter applies the same 5 coefficients to every sample. Which locality do the coefficients show?

2. A loop reads 256 consecutive 4-byte floats into an empty cache with 64-byte blocks. How many misses?

Answer: misses

3. A direct-mapped cache has 4 lines of 16 bytes and starts empty. The CPU reads these byte addresses in order: 124, 272, 272, 368, 20, 20, 272, 144, 144, 144. How many reads hit?

Answer: hits

4. Reading every 64th byte with 16-byte blocks gives 100% misses. What happens if blocks grow to 32 bytes?

5. Which list is ordered from fastest to slowest?

Check these in the lesson

Week 21: Inside a cache: tags, sets and ways

1. A 32 KB 4-way set-associative cache has 16-byte blocks and 64-bit byte addresses. How many offset bits are there?

Answer: bits

2. A 8 KB direct-mapped cache has 128-byte blocks and 32-bit byte addresses. How many offset bits are there?

Answer: bits

3. A direct-mapped cache has 4 lines of 16 bytes and starts empty. The CPU reads these byte addresses in order: 124, 272, 272, 368, 20, 20, 272, 144, 144, 144. How many reads hit?

Answer: hits

4. Going from direct-mapped to 4-way set-associative at the same capacity mainly costs…

5. A single set with 2 ways and LRU replacement sees blocks A, B, A, C, B. Which accesses hit?

6. How many single-bit XNOR gates do the tag comparators of an 8-way cache with 20-bit tags need?

Answer: XNORs

Check these in the lesson

Week 21: Average memory access time

1. A cache has a hit time of 3 cycles, a miss rate of 1% and a miss penalty of 100 cycles. What is the AMAT in cycles?

Answer: cycles

2. L1: hit time 1 cycles, miss rate 10%. L2: hit time 8 cycles, local miss rate 10%. Main memory: 300 cycles. What is the AMAT in cycles?

Answer: cycles

3. A cache has a hit time of 2 cycles, a miss rate of 5% and a miss penalty of 100 cycles. What is the AMAT in cycles?

Answer: cycles

4. L1 miss rate is 4% and L2 local miss rate is 25%. What percentage of all accesses go to main memory?

Answer: %

5. AMAT = 1 + 0.08 × 50. Which single change helps most?

6. Base CPI is 1. There are 0.4 memory accesses per instruction, L1 hit time is included in base CPI, and AMAT is 3 cycles with a 1-cycle hit time. What is the effective CPI?

Answer:

Check these in the lesson

Week 22: Hardware or software? Partitioning a task

1. 80% of a program's run time is moved onto a hardware accelerator that makes that part 2× faster. What is the overall speed-up?

Answer: ×

2. 50% of a program's run time is moved onto a hardware accelerator that makes that part 20× faster. What is the overall speed-up?

Answer: ×

3. Which function is the best candidate for a hardware accelerator in a drone?

4. How many levels of 2-input XOR gates does a balanced parity tree need for a 32-bit word?

Answer: levels

5. A task is 40% accelerable. What is the best overall speed-up any accelerator can give?

Check these in the lesson

Week 22: Inside an integrated circuit

1. Why are standard cells all the same height?

2. A critical path totals 400 ps of logic and wire, plus 60 ps clock-to-Q, 40 ps setup and 25 ps skew. Maximum clock frequency in GHz?

Answer: GHz

3. An unbuffered wire 1 mm long has 20 ps delay. Using the RC model (delay ∝ L²), what is the delay of a 3 mm wire?

Answer: ps

4. Why does clock gating an idle block save power?

5. A chip switches an effective capacitance of 1 nF with activity factor α = 0.3, at 0.7 V and 2 GHz. What is its dynamic power in watts?

Answer: W

Check these in the lesson

Week 22: Wafers, lithography and yield

1. With a Poisson yield model Y = e^(−D·A), what percentage of 20 mm² dies work when the defect density is 0.3 defects per cm²?

Answer: %

2. Estimate the whole dies on a 200 mm wafer for a 200 mm² die using DPW = π(d/2)²/A − πd/√(2A). Round down.

Answer: dies

3. A processed 300 mm wafer costs $5000 (an illustrative figure). It holds 306 dies of 200 mm², and the defect density is 0.1 per cm² (yield Y = e^(−D·A)). What is the cost per good die in dollars?

Answer: $

4. Which order is right for patterning one layer?

5. What does a process node name such as '5 nm' mean today?

6. With D = 0.2 /cm², what is the yield (as a percentage) of one 6 cm² monolithic die? (Four 1.5 cm² chiplets would each yield 74%.)

Answer: %

Check these in the lesson

Week 23: Training versus inference: counting the cost

1. A convolution layer takes a 8×8 image with 8 channels and produces a 8×8 output with 32 channels using 5×5 kernels. How many MACs does it need?

Answer: MACs

2. A network has two fully connected layers: 784 inputs → 16 hidden units → 2 outputs. How many multiply-accumulate operations (MACs) does one inference need (ignore biases and activations)?

Answer: MACs

3. Which phase normally runs on a battery-powered sensor?

4. A model needs 3,000,000 MACs. The core does 2 MACs per cycle at 80 MHz. Ignoring memory stalls, what is the latency in ms?

Answer: ms

5. A neural network has 600000 weights stored at 16 bits each. How many kilobytes (1 KB = 1024 bytes) do the weights occupy?

Answer: KB

Check these in the lesson

Week 23: Quantisation: fewer bits, smaller models

1. Weights lie in [−2, 2] and are quantised to symmetric int8 with qmax = 127. What is the scale (step size)?

Answer:

2. A neural network has 50000 weights stored at 4 bits each. How many kilobytes (1 KB = 1024 bytes) do the weights occupy?

Answer: KB

3. With scale 0.02, what integer does w = −0.537 quantise to (round to nearest)?

Answer:

4. One weight in a layer is 50× larger than all the others. What happens with a single per-layer int8 scale?

5. Which evaluation of an int8 model is fair?

Check these in the lesson

Week 23: Fitting a model into memory, time and energy

1. One inference performs 1000000 MACs at 0.2 pJ each and reads 50000 bytes from memory at 100 pJ per byte. What is the energy per inference in microjoules (µJ)?

Answer: µJ

2. One inference performs 50000 MACs at 3 pJ each and reads 10000 bytes from memory at 5 pJ per byte. What is the energy per inference in microjoules (µJ)?

Answer: µJ

3. A network has two fully connected layers: 64 inputs → 32 hidden units → 4 outputs. How many multiply-accumulate operations (MACs) does one inference need (ignore biases and activations)?

Answer: MACs

4. Your model's weights fit in flash, but one layer's input and output activations together exceed RAM. What is the most direct fix?

5. A 200 mAh, 3 V coin cell stores about 2,160 J. If each inference costs 5 µJ and nothing else used energy, how many inferences is that? (Answer in millions.)

Answer: million

Check these in the lesson

Week 24: Power, performance and area

1. A chip switches an effective capacitance of 0.5 nF with activity factor α = 0.2, at 0.9 V and 3 GHz. What is its dynamic power in watts?

Answer: W

2. A chip switches an effective capacitance of 5 nF with activity factor α = 0.1, at 0.8 V and 0.5 GHz. What is its dynamic power in watts?

Answer: W

3. Voltage drops from 1.1 V to 0.8 V and frequency from 2.4 GHz to 1.2 GHz. What fraction of the original dynamic power remains? (Answer as a decimal.)

Answer:

4. Halving the clock frequency at the same voltage changes dynamic energy per operation by…

5. Replacing one fast core with four slow low-voltage cores at equal throughput mainly costs…

Check these in the lesson

Week 24: Energy budgets and duty cycling

1. A sensor node wakes every 5 s, runs for 2 ms at 30 mW, and sleeps the rest of the time at 10 µW. What is its average power in microwatts (µW)?

Answer: µW

2. A sensor node wakes every 2 s, runs for 50 ms at 5 mW, and sleeps the rest of the time at 1 µW. What is its average power in microwatts (µW)?

Answer: µW

3. A device averages 50 µW from a battery storing 10,000 J. Ignoring self-discharge, how many days will it last?

Answer: days

4. A node's average is 200 µW active + 3 µW sleep. Which change helps most?

5. Core A runs a task in 2 ms at 30 mW; core B takes 10 ms at 8 mW. Both sleep afterwards at the same power. Which uses less energy for the task?

Check these in the lesson

Week 24: Reduced precision: range, resolution and error

1. What is the step size (resolution) of a signed Q4.12 number?

Answer:

2. What is the largest value a signed Q4.12 (16-bit) number can hold? (Give it to 4 decimal places.)

Answer:

3. Multiplying two Q1.15 numbers gives a 32-bit result in which format?

4. A neural network has 120000 weights stored at 8 bits each. How many kilobytes (1 KB = 1024 bytes) do the weights occupy?

Answer: KB

5. Why write the accuracy requirement before testing precisions?

Check these in the lesson

Week 25: Gradient descent and the learning rate

1. Minimise f(x) = 1(x − -2)² by gradient descent with learning rate η = 0.2, starting from x₀ = 8. What is x after 6 steps?

Answer:

2. Minimise f(x) = 0.5(x − 3)² by gradient descent with learning rate η = 0.05, starting from x₀ = -4. What is x after 5 steps?

Answer:

3. f(x, y) = ½(3x² + 12y²). What is the largest learning rate for which gradient descent converges? (Strict upper bound.)

Answer:

4. Gradient descent zig-zags slowly down a long, narrow valley. The most direct cure is…

5. For f(x) = ½·5x², which learning rate reaches the minimum in exactly one step from any start?

Answer:

Check these in the lesson

Week 25: Convexity and local minima

1. Which function is convex on all real x?

2. Your optimiser returns a point with zero gradient on a convex objective. What can you conclude?

3. For f(x) = (x² − 1)², below what value of |x| is f''(x) negative? (3 decimal places.)

Answer:

4. Minimise f(x) = 1(x − 3)² by gradient descent with learning rate η = 0.25, starting from x₀ = 8. What is x after 3 steps?

Answer:

5. You tune a robot arm design with a non-convex objective. What is the honest report?

Check these in the lesson

Week 25: Newton's method, momentum and constraints

1. Apply one step of Newton's method to f(x) = 3x² − 12x + 1 from x₀ = 10. What is x₁?

Answer:

2. Minimise (x − 2)² subject to x ≤ 1 with the penalty μ(x − 1)² for x > 1 and μ = 9. What x does the penalised problem give?

Answer:

3. For a problem with a million variables, why is plain Newton's method rarely used?

4. A motor current must never exceed its rating. Which constraint method suits that best?

5. Minimise f(x) = 2(x − 1)² by gradient descent with learning rate η = 0.05, starting from x₀ = 5. What is x after 4 steps?

Answer:

Check these in the lesson

Week 26: Benchmarking computer systems fairly

1. Why discard warm-up runs?

2. Sixteen paired runs give a mean difference of 0.8 ms with standard deviation 1.6 ms. What is the standard error of the mean difference, in ms?

Answer: ms

3. Design A: 10 ms, 50 mJ. B: 12 ms, 30 mJ. C: 14 ms, 55 mJ. Which are Pareto-optimal (lower is better on both)?

4. A program executes 200 million instructions with an average CPI of 1.8 on a 3 GHz processor. How long does it take, in milliseconds?

Answer: ms

5. Which practice makes a two-system timing comparison fairest?

Check these in the lesson

Week 26: Ablations: which part made it better?

1. Which is an ablation?

2. A 2×2 study of predictor (P) and cache (C) gives run times (ms): neither 100, P only 80, C only 70, both 55. What is the main effect of P (ms)?

Answer: ms

3. A direct-mapped cache has 4 lines of 16 bytes and starts empty. The CPU reads these byte addresses in order: 124, 272, 272, 368, 20, 20, 272, 144, 144, 144. How many reads hit?

Answer: hits

4. A cache has a hit time of 2 cycles, a miss rate of 8% and a miss penalty of 150 cycles. What is the AMAT in cycles?

Answer: cycles

5. Doubling the L1 cache cut run time by 20%. Which follow-up best explains it from first principles?

Check these in the lesson

Week 27: Designing an architecture comparison

1. Which is the best research question for an adder comparison?

2. With a model of 2 gate delays per bit for the carry, what is the worst-case carry delay of a 24-bit ripple-carry adder, in gate delays?

Answer: gate delays

3. How many times is work() called when n = 210? Code: for i in 0 … n−1: for j in i+1 … n−1: work()

Answer: calls

4. Why measure several sizes rather than one?

5. 90% of a program's run time is moved onto a hardware accelerator that makes that part 5× faster. What is the overall speed-up?

Answer: ×

Check these in the lesson

Week 27: Explaining results from first principles

1. A program executes 750 million instructions with an average CPI of 0.8 on a 2 GHz processor. How long does it take, in milliseconds?

Answer: ms

2. A pipeline has base CPI 1. Branches are 15% of instructions, 20% of them are mispredicted, costing 2 cycles each. Loads and stores are 20% of instructions, 10% of them miss in the cache, costing 100 cycles each. What is the effective CPI?

Answer:

3. Version B executes 0.5× the instructions of A, and its CPI falls from 2.0 to 1.5. Same clock. What speed-up does the Iron Law predict?

Answer: ×

4. Your model predicts 2.0× and you measured 2.9× ± 0.2. What should the report say?

5. L1: hit time 2 cycles, miss rate 5%. L2: hit time 8 cycles, local miss rate 40%. Main memory: 200 cycles. What is the AMAT in cycles?

Answer: cycles

6. Which is a genuine limitation to state for a browser-simulated precision study?

Check these in the lesson