Skip to content
Tactiverge

Olympiad · Practice · public practice problem

Fitting an instruction into 32 bits

Difficulty 3 of 510 points in 5 partsSuggested time ~18 min (never timed here)

The problem

A teaching processor uses 32-bit instructions. A register-immediate format holds a 6-bit opcode, three register fields (destination and two sources) for a machine with 32 registers, and uses every remaining bit as a two's-complement immediate.

  1. Part (a) · 1 point

    How many bits does each register field need?

    (pure number)Tolerance: exact

  2. Part (b) · 2 points

    How many bits are left for the immediate?

    (pure number)Tolerance: exact

  3. Part (c) · 2 points

    What is the largest positive immediate value?

    (pure number)Tolerance: exact

  4. Part (d) · 3 points

    If the machine grows to 64 registers (format otherwise unchanged), what is the most NEGATIVE immediate?

    (pure number)Tolerance: exact

  5. Part (e) · 2 points · rubric with 2 criteria

    Give one advantage and one cost of moving to 64 registers in this format.

    Written parts stay in your browser. Reveal the worked solution to mark yourself against the rubric.

Checked so far: 0 of 8 automatically marked points, plus 2 for written parts you mark yourself against the rubric. Nothing is saved.

Stuck? Hints, then the worked solution

Written with AI assistance. Review status: technically-checked (answers recomputed independently with units verified by automated tests); not yet reviewed by an educator or judge.