APDR

Numbers, Caches, and Memory Models Lab

Algorithms, Programming, and Data Representation · Module 92313 · Chapter 56a

Commit to a prediction, rate your confidence, then watch the representation or calculation unfold. Finish each experiment to open its sandbox.

How the lab works

  1. Predict. Choose an answer before the stage reveals the result.
  2. Rate your confidence. A sure but wrong answer appears in Your results as a useful review target.
  3. Watch the steps. Follow the integer or floating-point calculation, cache lookup, or multicore state change.
  4. Explore. Complete all four challenges to unlock the experiment controls.

3.1–3.2 Integer representations: encode and decode

Convert values between bases, then decode the same fixed-width bits under named integer encodings.

Name the base, encoding, and bit width

Explore integer representations

Result: —

3.4–3.5 Binary arithmetic: carry and overflow

Compare unsigned arithmetic with signed fixed-width arithmetic. Carry-out and signed overflow answer different questions.

Keep the operation and the encoding explicit

Calculate binary arithmetic

Result: —

4.4 IEEE 754 fields: decode single precision

Single precision stores one sign bit, eight exponent bits, and 23 fraction bits. Reserved exponent patterns identify zero, subnormal values, infinity, and NaN.

Decode all 32 bits before assigning a value

Decode a 32-bit word

Fields: —

4.5 Numerical stability: cancellation and reformulation

Track how rounding affects close values. Compare a direct calculation with a stable formula that avoids subtracting nearly equal quantities.

An exact operation can still expose earlier rounding

Explore numerical stability

Result: —

2.1–2.2 Cache locality and mapping

Trace the weighted cost of a miss and map byte addresses to cache sets. The sandbox uses a simplified two-level cache or a set-index calculation.

Only a miss pays the next-level access time.

Explore cache behaviour

Result: —

3.1–3.2 Coherence and consistency

Separate a cache-line ownership transition from the ordering guarantees of the memory model.

Coherence orders one address; consistency constrains observations across addresses.

Explore multicore state

Result: —

Your results

Personal study lab based on the APDR Chapter 56a guide and supplied lecture notes, including “FAU_beamer_56a.pdf” (55 slides, 26 October 2025). The controls illustrate selected finite-precision cases and do not model every platform or rounding mode. Not an official FAU publication; check course details against the current materials. Made by Thanate Amornjiraporn (Focus).