Consider a processor with 64 registers and an instruction set of size twelve.…

2016

Consider a processor with 64 registers and an instruction set of size twelve. Each instruction has five distinct fields, namely, opcode, two source register identifiers, one destination register identifier, and a twelve-bit immediate value. Each instruction must be stored in memory in a byte-aligned fashion. If a program has 100 instructions, the amount of memory (in bytes) consumed by the program text is __________ .

Answer: 500Answer: 500 bytes. Explanation: Opcode: need ceil(log2(12)) = 4 bits (since 2^4 = 16 ≥ 12). Register identifiers: 64 registers → 6 bits each. Three register…

Attempted by 52 students.

Show answer & explanation

Correct answer: 500

Answer: 500 bytes.

Explanation:

  • Opcode: need ceil(log2(12)) = 4 bits (since 2^4 = 16 ≥ 12).

  • Register identifiers: 64 registers → 6 bits each. Three register fields (two sources + one destination) → 3 × 6 = 18 bits.

  • Immediate field: 12 bits.

  • Total bits per instruction: 4 + 18 + 12 = 34 bits.

  • Byte-aligned storage: ceil(34/8) = 5 bytes per instruction.

  • For 100 instructions: 100 × 5 = 500 bytes.

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

Explore the full course: Computer Architecture

Loading lesson…