Skip to content
GATEiit

GATE EC 2024 Q27: Largest unsigned immediate in a 32-bit instruction with 24 registers and 40 opcodes

Syllabus topic: Machine instructions and addressing modes

Question

A machine has a 32-bit architecture with 1-word long instructions. It has 24 registers and supports an instruction set of size 40. Each instruction has five distinct fields, namely opcode, two source register identifiers, one destination register identifier, and an immediate value. Assuming that the immediate operand is an unsigned integer, its maximum value is ________.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 2047 (official GATE 2024 final answer key)

Concept used: Each field needs ⌈log⁡2N⌉ bits to encode N choices; the bits left over in the instruction word go to the immediate, whose largest unsigned value is 2b−1.

Concept notes

Loading notes…

First step: Work out the bits for the opcode (40 choices) and for each of the three register fields (24 choices), and subtract their total from 32 to get the immediate width.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

Share this question

WhatsAppDownload image

Source: official GATE 2024 EC question paper and final answer key, organised by IISc Bengaluru. Question paper · Answer key