# Advanced foundation workbook — modules 12–14

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.

## a12-environment: Make transition order part of the oracle

Module m12; objective FSC-35; practice; version 1.

A toy queue environment has capacity 5, starting occupancy 4 and five arrivals. The action delivers up to 3 existing records and costs 1. Its specified order is drain first, then admit arrivals, dropping newest when full. Reward=2×delivered −5×dropped −ending_occupancy−action_cost. Compute delivered, admitted, dropped, ending occupancy and reward. Then compute the same quantities for a mistaken admit-first implementation that drains only afterward. Explain why equal action inputs do not make those transitions equivalent.

Your first answer:

Revision and help used:

## a12-transfer: Choose a valid RL offload boundary

Module m12; objective FSC-36; transfer; version 1.

A host environment step costs 15 microseconds; policy evaluation costs 2 and training costs 3 per transition. A proposed device environment step costs 0.5 plus 12 microseconds communication per request. Costs are sequential with no overlap. Compare a host-only transition, one individually offloaded transition, and a batch of eight independent environments with actions already chosen and one 12-microsecond batch overhead. Include policy/training work in every comparison. The baseline and candidate both update policy only after the batch. State why eight future actions from one observation-dependent environment are a different case. Define the run, environment, policy-version and reset identity needed to match returned transitions.

Your first answer:

Revision and help used:

## a13-scoreboard: Find what a checksum-style test discards

Module m13; objective FSC-38; practice; version 1.

A transform must emit (tag,2×x+1) for each accepted input, in order, with no overflow in this case. Accepted inputs are (6,−2),(7,0),(8,3). A candidate emits (6,−3),(8,7),(7,1). Give the expected sequence and first mismatch. Calculate the output-value sum for each sequence and explain why a count-plus-sum checker passes this defective result.

Your first answer:

Revision and help used:

## a13-transfer: Write a checker that can reject the fast-looking design

Module m13; objective FSC-39; transfer; version 1.

A conceptual streaming block accepts (tag,x0,x1), with integer inputs −4…4, and emits (tag,x0−2×x1) exactly once in order. While output valid=1 and ready=0, data/tag/valid must hold. Reset flushes pending work and no transfer counts during reset. If ready stays 1 after an input acceptance, its output must transfer within the next 3 edges. Write a simple independent oracle and five short adversarial tests, each with stimulus and expected observation. Include numeric extremes, distinct tags, a stall, reset with work pending, and a test/coverage check that exposes an always-ready environment assumption. State what passing these finite tests would still leave unproved.

Your first answer:

Revision and help used:

## a14-equivalence: Check every declared output

Module m14; objective FSC-40; practice; version 1.

For integer x in 0…15, the required pair is (clamp(x−10,−2,2), int(clamp(x−10,−2,2)>0)). Candidate A returns the clamp and int(x>10). Candidate B returns (int(x>10),int(x>10)). Candidate C returns the clamp and int(clamp(x−10,−2,2)>=0). Which candidates meet the full pair contract on this finite domain? Give a counterexample for each failing candidate. Explain which optimization is valid for a flag-only interface.

Your first answer:

Revision and help used:

## a14-transfer: Keep the agent’s search honest about the objective

Module m14; objective FSC-42; transfer; version 1.

A bounded agent search may change pipeline cuts/resource sharing for a fixed tagged transform, but must preserve all outputs, order, reset and stall behavior. Required toy period ≤5 ns and complete request latency ≤12 microseconds. Host-only software meets the behavior and takes 12 microseconds. Candidate A reports period 2 ns, compute 1 microsecond, transfer 10 and host overhead 3; it fails one frozen required stall case. Candidate B reports period 4 ns, compute 2, transfer 10 and overhead 3; all listed required tests pass. Classify both candidates against each requirement. Design a request/result record and a limit of four candidate evaluations that cannot be bypassed by the agent deleting a failing case. State which result would justify an overall speedup claim.

Your first answer:

Revision and help used:
