APDR

Integer and Floating-Point Representation Lab

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

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 bit conversion, field decode, rounding, or error check.
  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.1 Floating-point spacing: range versus precision

The exponent scales the number line. The significand precision sets the local spacing between representable values.

Equal exponent steps produce wider gaps at larger magnitudes

Compare representable spacing

Gap: —

4.2 Binary fractions: convert place values

Each binary place after the point is half the value of the previous one. Some decimal fractions therefore repeat in binary.

Read each fractional place as a negative power of two

Convert binary fractions

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: —

Your results

Personal study lab based on the APDR Chapter 34a guide and supplied lecture notes, including “APDR lecture 2 extended”, slides 1–23. 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).