The GATE Grind

GATE 2018 CS – Question 61

Computer Organization and Architecture · Instruction Set and Addressing Modes · 2 marks · Numerical answer

A processor has 16 integer registers (R0, R1, ..., R15) and 64 floating point registers (F0, F1, ..., F63). It uses a 2-byte instruction format. There are four categories of instructions: Type-1, Type-2, Type-3, and Type-4. Type-1 category consists of four instructions, each with 3 integer register operands (3Rs). Type-2 category consists of eight instructions, each with 2 floating point register operands (2Fs). Type-3 category consists of fourteen instructions, each with one integer register operand and one floating point register operand (1R+1F). Type-4 category consists of N instructions, each with a floating point register operand (1F).

The maximum value of N is ________.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 32

Explanation

The instruction is 16 bits. Type-1 uses $4\times2^{12}$ encodings ($3\times4$ bits of registers): $4\cdot2^{12}=2^{14}$. Type-2 uses $8\cdot2^{12}=2^{15}$ ($2\times6$ bits). Type-3 uses $14\cdot2^{10}$ ($4+6$ bits) $=14336$. Total used $=16384+32768+14336=63488$. The remainder is $65536-63488=2048$, and each Type-4 instruction needs $2^6=64$ encodings, so $N=\frac{2048}{64}=32$.