Course: Computer Architectures
Final results: Lab 02 - Neural Computation and Amdahl Law
Date reviewed: 12 October 2026
Scope
The user supplied another completed report and its assembly source for comparison. The private reference copies are retained under 40 Projects/Computer Architectures/Lab 02 Submission/Comparison/. The measurements below from that report are reported values, not independently rerun observations. The final program’s results were measured separately and belong to its source.
What agrees
Both implementations use 30 inputs and weights equal to one, bias 171.0 and an extra one constant. Both produce the expected normal result x = 201, y approximately 0.0049751243 and declare 256 bytes of data. Each has 30 multiplications and one division on the normal activation path.
Source differences
| Detail | Alternate implementation | Final implementation |
|---|---|---|
| Accumulator initialization | Loads bias directly into f0 | Starts f0 at zero |
| Bias addition | Included before the loop | Separate addition after the loop |
| FP additions | 30 | 31 |
| Normal-path FP moves | 2 | 2 |
| FP comparison | 1 feq.s | None |
| Zero test | feq.s then bnez | Integer magnitude-bit check |
| Normal computation instructions | 267 | 268 |
The alternate startup has 8 machine instructions, its 30 iterations have 240, and its post-loop normal path has 19: total 267, excluding the same three exit instructions. The final version totals 268.
Bias-first accumulation gives the same result for these exact inputs. In general, floating-point addition is not associative, so bias-first and bias-last can round differently. Bias-last follows the assignment’s expression order directly. This difference alone is not proof that the alternate normal result is wrong.
Manual latency assumption
The alternate report assumes both FP moves take one EX cycle and explicitly identifies this as unverified. Our simulator CSV shows fmv.w.x and fmv.x.w each occupying four EX cycles at the initial FP ALU setting.
Applying that observed mapping to the alternate source gives 33 FP ALU operations: 30 additions, one comparison and two moves. Its other 203 instructions use one EX cycle each:
The report’s assumption gives 539 instead, undercounting by six relative to this mapping. The comparison instruction’s four-cycle mapping was also observed in the earlier local version; this is not a claim about every possible simulator release.
| Alternate manual case | Reported EX cycles | EX cycles using observed mapping | Corrected time at 15 MHz (µs) |
|---|---|---|---|
| Initial | 539 | 545 | 36.3333 |
| MUL 6 → 2 | 419 | 425 | 28.3333 |
| DIV 30 → 10 | 519 | 525 | 35.0000 |
Its manual Amdahl configuration 1 also omits the moves from the affected FP ALU work. Using the observed mapping, the alternate source would have EX sums 512 / 485 / 525 and speedups 545/512 = 1.064453, 545/485 = 1.123711 and 545/525 = 1.038095. These are recalculations, not new simulator measurements.
Reported simulator results versus final measurements
| Experiment | Alternate report cycles | Final measured cycles |
|---|---|---|
| Forwarding off, initial | 726 | 720 |
| Forwarding off, MUL latency 2 | 606 | 600 |
| Forwarding off, DIV latency 10 | 706 | 700 |
| Forwarding on, initial | 579 | 574 |
| Forwarding on, FP ALU latency 3 | 576 | 575 |
| Forwarding on, FP MUL latency 4 | 519 | 514 |
| Forwarding on, FP DIV latency 10 | 559 | 554 |
The alternate forwarding IPC is 267/579 = 0.461140; final IPC is 268/574 = 0.466899. Its forwarding reduction is 147 cycles; the final source’s reduction is 146.
| Table 5 measured speedup | Alternate report | Final experiment |
|---|---|---|
| FP ALU 4 → 3 | 1.005208 | 0.998261 |
| FP MUL 6 → 4 | 1.115607 | 1.116732 |
| FP DIV 30 → 10 | 1.035778 | 1.036101 |
Different instruction sequences alter dependencies and resource scheduling. Different cycle totals are not automatically errors. Both datasets show multiply and divide savings of 60 and 20 cycles in Table 5. The differing FP ALU response must be interpreted against each source, not averaged or substituted.
Zero check and simulator limitation
The alternate feq.s / bnez sequence is valid RISC-V. The same pattern in our earlier bias-last program fell through with x = 0 and computed Infinity, with forwarding off and on. A diagnostic retained equality result 1 despite the fallthrough. The precise simulator cause remains unresolved.
We did not rerun the alternate source with its own zero-producing inputs, so we cannot claim that its exact program fails that case. Its PDF does not document separate zero/exponent activation experiments. Our final program replaced that dependency with an integer magnitude-bit test and verified both activation conditions in separate copies.
Conclusion
The alternate source’s normal result and 267-instruction count are consistent with its code. Its manual move-latency assumption needs correction for the observed local simulator mapping. Its simulation claims require its own evidence to verify. The final report is more strongly supported for the final source because its latency mapping, measurements and both activation conditions were checked. Keep each report with its corresponding assembly and settings.