# Advanced foundation workbook — modules 9–11

These are conceptual tasks for a programmer learning hardware design. Start with the transfer task if the earlier practice is already comfortable. Use the guided and debug tasks for a specific gap. Keep first answers and assistance separate. No task requires a tool installation or board.

## a09-range: Distinguish wrap, saturation and gain

Module m09; objective FSC-26; practice; version 1.

A signed 16-bit sample integer q represents q/32768. Two channels each contain q=20480. First accumulate exactly in a wider integer. Give the exact sum and represented amplitude. Then give the signed 16-bit result under (a) retaining only low 16 bits, (b) clamping to the signed 16-bit range, and (c) dividing the wide sum by 2 before storing. All divisions here are exact. Explain why these are three different signal policies.

Your first answer:

Revision and help used:

## a09-transfer: Make a coherent four-voice instrument contract

Module m09; objective FSC-27; transfer; version 1.

A toy instrument mixes four arbitrary signed 12-bit voice samples each sample enable. Its N=10 phase accumulator advances by 16 at 16,384 sample enables/s. A host may pause while writing a new frequency word and gain in several transactions. Give the minimum signed width for the exact four-voice sum and the ideal phase-rotation frequency. Design when the new frequency/gain pair becomes active, and define what happens to a timestamped note command that arrives after its intended sample. State one test that could expose a mixed configuration. Physical audio timing is outside this model.

Your first answer:

Revision and help used:

## a10-boundary: Carry a pixel through a frame boundary

Module m10; objective FSC-29; practice; version 1.

A fictional raster has 6 active pixels plus 2 blanking slots per line and 3 active lines plus 1 blanking line per frame. Number request slots from 0. A slot is active only when its column<6 and line<3. Frame ID starts at 0. A fixed lookup returns each requested color exactly 2 slots later. For requests 30,31,32,33, give request frame ID and active flag, and give the output slot carrying each matching pair. Treat this as a stream model, not a display standard.

Your first answer:

Revision and help used:

## a10-transfer: Choose what a waveform viewer sends

Module m10; objective FSC-30; transfer; version 1.

A waveform viewer receives 64,000 signed 16-bit samples/s. A proposed device sends min/max summaries for 200 display columns, 25 frames/s, storing each min and max as one 16-bit value. The link can carry 32,000 payload bytes/s; this already excludes headers and other overhead. Calculate raw and summary payload rates. Choose a host/device split that fits the link, state one question the summary cannot answer, and define how one displayed frame avoids mixing summary results from two captures. A later user may want to zoom into the raw waveform.

Your first answer:

Revision and help used:

## a11-join: Diagnose a join after filtering

Module m11; objective FSC-31; practice; version 1.

Left emits records with IDs 2,3,4; right emits 2,4 because its filter removed 3. A next-with-next join does no ID comparison. List its produced pairs and the leftover record. Then propose a bounded policy that avoids combining different IDs without waiting forever for right 3.

Your first answer:

Revision and help used:

## a11-transfer: Keep semantic counts correct under capture loss

Module m11; objective FSC-33; transfer; version 1.

A bounded ML-feature monitor receives records R1…R6 in order. A length≤32bytes is valid. Their(length,match) pairs are R1(12,yes), R2(40,yes), R3(12,no), R4(12,yes), R5(12,yes), R6(12,yes). Invalid records never reach the match stage. Counters received,valid,matched,captured,capture_dropped start at 0 for this interval. A depth 3 detail queue already contains one old record Z, has no departures during the interval, and drops newest when full. Give final counters and queue order. Later UDP delivery can reorder the retained details. Specify fields and a snapshot/overflow policy that let the host reconstruct what the summary actually counted without treating arrival order as capture order.

Your first answer:

Revision and help used:
