GATE / CS ARCHIVE

GATE CSE 2016 SET 2 / QUESTION 10

GATE CSE 2016 Set 2 Q10

Computer Organization & Architecture · Instructions & Addressing Modes · Full GATE CSE 2016 Set 2 paper

GATE 2016 Set 2, Q10 1 mark · NAT
Report issue

Instructions & Addressing Modes

Question 10, GATE 2016: A processor has 40 instructions and 24 general-purpose registers. Its 32-bit instruction has an opcode, two register fields and an immediate field. How many bits remain for the immediate?
Tap to enlarge
Answer & solution

Official answer: 16.0 : 16.0

Our answer: 16

Forty opcodes require ceil(log₂40)=6 bits. Each of 24 registers requires 5 bits, so two register fields need 10. The immediate field has 32−6−10=16 bits.

An r-bit identifier distinguishes at most 2r possibilities. Five opcode bits cover only 32 instructions, so six are needed; four register bits cover only 16 registers, so five are needed per operand. Some encodings remain unused, but fractional bit fields are impossible in this fixed-field format.

Original paper, page 27 · Answer key