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

DetailAlternate implementationFinal implementation
Accumulator initializationLoads bias directly into f0Starts f0 at zero
Bias additionIncluded before the loopSeparate addition after the loop
FP additions3031
Normal-path FP moves22
FP comparison1 feq.sNone
Zero testfeq.s then bnezInteger magnitude-bit check
Normal computation instructions267268

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 caseReported EX cyclesEX cycles using observed mappingCorrected time at 15 MHz (µs)
Initial53954536.3333
MUL 6 → 241942528.3333
DIV 30 → 1051952535.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

ExperimentAlternate report cyclesFinal measured cycles
Forwarding off, initial726720
Forwarding off, MUL latency 2606600
Forwarding off, DIV latency 10706700
Forwarding on, initial579574
Forwarding on, FP ALU latency 3576575
Forwarding on, FP MUL latency 4519514
Forwarding on, FP DIV latency 10559554

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 speedupAlternate reportFinal experiment
FP ALU 4 → 31.0052080.998261
FP MUL 6 → 41.1156071.116732
FP DIV 30 → 101.0357781.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.