LOGBOOK

HELP

Quiz Entry - updated: 2026.07.07

What are the key takeaways about computer number representations?

The big idea: bits are just bits — the encoding decides their meaning, two's complement lets signed math reuse the unsigned adder, and most bugs come from type/overflow surprises.

These are the ideas that tie the whole topic together; internalize just these few and the bit-level details mostly follow from them on their own:

  1. Encoding matters: Same bits, different meaning (signed vs unsigned)

  2. Two's complement: Sign bit has negative weight; range is asymmetric

  3. Overflow wraps: Unsigned is defined (mod 2^w); signed is undefined behavior

  4. Casting preserves bits: Only interpretation changes, not the pattern

  5. Shift operations:

    • Left shift = multiply by 2^k
    • Right shift = divide by 2^k (but rounds differently for negative signed)
  6. Mixing types is dangerous: Signed-to-unsigned conversion in comparisons causes subtle bugs

Tip: When in doubt about bit-level behavior, work through small examples by hand (4-bit is usually enough to see the pattern).

From Quiz: REVE1 / Number Representations | Updated: Jul 07, 2026