Exercises — Dataflow architectures
Before we start, one shared picture that every exercise leans on:

Level 1 — Recognition
Exercise 1.1
For each item, say whether it belongs to a Von Neumann machine or a dataflow machine: (a) program counter, (b) firing rule, (c) tokens on edges, (d) fetch–decode–execute in address order, (e) "instruction runs when its operands are ready".
Recall Solution 1.1
(a) Von Neumann — the program counter is the address-marcher. (b) Dataflow — firing rule replaces the PC. (c) Dataflow — data lives as tokens on graph edges. (d) Von Neumann — order comes from instruction addresses. (e) Dataflow — this is the firing rule stated in words. Why: a program counter and a firing rule are two rival answers to the single question "what decides when an instruction runs?". A machine uses one or the other, never both as the master.
Exercise 1.2
The program is . How many nodes and how many edges does its dataflow graph have? (Count the input tokens as sources feeding edges, not as nodes.)
Recall Solution 1.2
Nodes = 3: one , one , one . Edges = 6: , , , , , . Look at figure s01: fans out to two different nodes, which is why contributes two edges, not one.
Level 2 — Application
Exercise 2.1
Using the graph of with , write the firing trace: which node fires at each time step, and what token it emits. Assume every operation takes exactly one time step.
Recall Solution 2.1
Step 0: source tokens arrive: . Step 1: the has both inputs () → fires → emits . The has both inputs () → fires → emits . Both in the same step, because their firing rules are satisfied at once and no edge connects them. Step 2: the now has and → fires → emits . Answer: , finished in 2 time steps.
Exercise 2.2
The same expression on a Von Neumann CPU that does one operation per step, in written order . How many time steps? What is the speed-up of dataflow over this?
Recall Solution 2.2
Von Neumann does (step 1), (step 2), (step 3) = 3 steps. Dataflow = 2 steps. Speed-up . Why the gain: the and are independent (no edge between them), so dataflow overlaps them into one step; the PC forced them apart.
Level 3 — Analysis
Exercise 3.1
The critical path is the longest chain of dependent nodes — the minimum number of steps no amount of hardware can beat. For , find the critical path length. Then argue why adding a third adder would not speed it up.

Recall Solution 3.1
The longest dependency chain is: (a or ) () = 2 nodes = 2 steps. Adding hardware can only help independent work run in parallel. But the must wait for its parent's token — that wait is a data dependency, not a shortage of adders. A third adder has nothing ready to do, so the answer stays 2 steps. In figure s02, the red path is the critical path; the extra adder (grey, dashed) sits idle. Rule of thumb: minimum time = length of critical path; maximum useful parallelism = width of the graph.
Exercise 3.2
Evaluate — a sum of 8 numbers built as a balanced tree. (a) How many nodes? (b) With unlimited hardware, how many steps? (c) How many steps would a strictly sequential accumulator (sum += next) take?
Recall Solution 3.2
(a) Adding 8 numbers needs 7 additions (each removes one number from the pile: needs merges). (b) The balanced tree has depth : level 1 does the four inner sums in parallel (1 step), level 2 does the two mid sums (1 step), level 3 does the final sum (1 step) → 3 steps. (c) A sequential accumulator does additions one after another → 7 steps. Speed-up , and it grows like for numbers.
Level 4 — Synthesis
Exercise 4.1
Draw (describe) the dataflow graph for the loop sum = sum + i running for , starting , in a static machine (at most one token per edge). Then explain, step by step, why iterations here cannot overlap.
Recall Solution 4.1
One node is reused. Its inputs are the current token and the current token; its output feeds back into the input edge (a cycle).
- : tokens → fires → .
- : now → fires → .
- : → fires → . Final . Why no overlap: the edge may hold only one token at a time (static rule). Iteration 2 literally cannot place its inputs until iteration 1's token has left the edge. Each iteration also needs the previous , so the loop-carried dependency chains them anyway. Both facts force strict serial order → 3 steps.
Exercise 4.2
Now unroll a loop whose body has no loop-carried dependency: out[i] = a[i] * b[i] for on a dynamic (tagged) machine. Tokens are written . Give the firing trace and the total steps.
Recall Solution 4.2
One node, but tokens carry tags (iteration stickers). The matching store fires the only for tokens whose tags agree.
- Ready set 1: → fire → .
- Ready set 2: → fire → .
- Ready set 3: same with . Because there is no loop-carried dependency (no output feeds a later input), all three tagged sets are independent. With three multiplier units they run in parallel = 1 step; with a single pipelined multiplier they stream through back-to-back. The point: tags let one graph host three concurrent instances without ever pairing with .
Level 5 — Mastery
Exercise 5.1
Modern out-of-order CPUs (Tomasulo's algorithm, reservation stations) are often called "a hidden dataflow engine". Map these dataflow concepts onto their CPU counterparts: (a) token, (b) tag, (c) firing rule, (d) matching store. Then say what dataflow does globally that Tomasulo does only locally.
Recall Solution 5.1
(a) token an operand value broadcast on the common data bus. (b) tag the register-renaming tag / reservation-station ID identifying which pending result this is. (c) firing rule a reservation station issues its instruction the instant all its source operands have arrived. (d) matching store the reservation stations watching the bus, grabbing values whose tags they await. Global vs local: dataflow expresses the entire program as one dependency graph, so parallelism is unlimited by program size. Tomasulo only sees a small instruction window (a few dozen in-flight instructions), so it re-discovers dataflow locally and briefly. Same idea, different scope. See Out-of-Order Execution.
Exercise 5.2
A computation has work operations and critical-path depth . (a) By dataflow's timing law, what is the fastest possible finishing time (unlimited hardware)? (b) How many processing units must you have so that finishing in steps is not blocked by lack of hardware? Use the rough balance . (c) What is the speed-up over running all ops sequentially?
Recall Solution 5.2
(a) Fastest time = critical-path depth = steps (nothing beats the longest dependency chain). (b) units. With fewer, some ready work would queue and push you past 8 steps; with more, the extra units idle. (c) Sequential time ; parallel time ; speed-up . This is the Instruction-Level Parallelism ceiling made explicit: dataflow reaches the natural limit set purely by the graph's shape.
Recall summary
Recall Quick self-quiz
Minimum steps in dataflow equal what? ::: The critical-path depth (longest chain of dependent nodes).
What limits how much hardware can help? ::: The graph's depth; parallelism only shrinks width, never depth.
Adding numbers as a balanced tree takes how many steps? ::: About steps, using additions.
Why can a static loop with sum+=i not overlap iterations? ::: One token per edge plus a loop-carried dependency forces strict serial order.
What do tags fix, and what can they NOT fix? ::: They fix naming/matching across concurrent instances; they cannot remove a real loop-carried data dependency.
Reservation stations in Tomasulo correspond to which dataflow unit? ::: The matching store (they fire when all tagged operands arrive).
With work and depth , roughly how many units keep you at the -step floor? ::: About .
Connections
- Dataflow architectures — the parent concepts these exercises drill.
- Directed Acyclic Graph (DAG) — the structure whose depth sets minimum time.
- Instruction-Level Parallelism — the natural ceiling exercise 5.2 computes.
- Out-of-Order Execution — the "hidden local dataflow engine" of exercise 5.1.
- Loop-Level Parallelism — exercises 4.1 vs 4.2 show when it is and isn't available.
- Systolic Arrays — another data-driven style with a fixed, regular graph.
- Von Neumann architecture — the sequential baseline every speed-up is measured against.