A machine has a 32-bit architecture, with 1-word long instructions. It has 64…

2014

A machine has a 32-bit architecture, with 1-word long instructions. It has 64 registers, each of which is 32 bits long. It needs to support 45 instructions, which have an immediate operand in addition to two register operands. Assuming that the immediate operand is an unsigned integer, the maximum value of the immediate operand is ____________.

Answer: 16383Key insight: the 32-bit instruction must encode the opcode, two register operands, and the unsigned immediate. Opcode bits = ceil(log2(45)) = 6 bits (because…

Attempted by 60 students.

Show answer & explanation

Correct answer: 16383

Key insight: the 32-bit instruction must encode the opcode, two register operands, and the unsigned immediate.

  • Opcode bits = ceil(log2(45)) = 6 bits (because 2^5 = 32 < 45 ≤ 64 = 2^6).

  • Each register needs 6 bits (64 registers → 6 bits). Two registers → 12 bits.

  • Bits used so far = 6 (opcode) + 12 (registers) = 18 bits.

  • Remaining bits for the immediate = 32 - 18 = 14 bits.

  • Maximum unsigned value representable in 14 bits = 2^14 - 1 = 16383.

Answer: 16383.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Computer Architecture

Loading lesson…