GATE / CS ARCHIVE

GATE CSE 2014 SET 1 / QUESTION 9

GATE CSE 2014 Set 1 Q9

Computer Organization & Architecture · Instructions & Addressing Modes · Full GATE CSE 2014 Set 1 paper

GATE 2014 Set 1, Q9 1 mark · NAT
Report issue

Instructions & Addressing Modes

Question 9, GATE 2014: A machine uses 32-bit words and one-word instructions. It has 64 registers, each 32 bits long. There are 45 instructions, each containing an unsigned immediate and two register operands. Find the largest representable immediate.
Tap to enlarge
Answer & solution

Official answer: 16383

1. Method and setup. Encoding 45 instruction choices needs six bits, since five bits distinguish only 32 choices. Each register identifier also needs six bits; the physical width of a register does not determine the width of its identifier. Allocate opcode and register fields first, then use all remaining bits for the immediate.

2. Work through the result and its assumptions. The opcode needs ceil(log₂45)=6 bits and each of two register fields needs log₂64=6 bits. The32-bit word leaves 32−6−12=14 immediate bits, whose unsigned maximum is 2¹⁴−1=16383.

Original paper, page 9 · Answer key