Computer Sciences > GATE 2026 SET-2 > Computer Organization
Consider a processor that has 16 general purpose registers and it uses 2-byte instruction format for all its instructions. Variable-sized opcodes are permitted. There are three different types of instructions; M-type, R-type, and C-type. Each M-type instruction has 2 register operands and a 6-bit immediate operand. Each R type instruction has 3 register operands. Each C-type instruction has a register operand and a 6-bit offset value. If there are 2 unique M-type opcodes and 7 unique R-type opcodes, which one of the following options gives the maximum number of unique opcodes possible for C-type instructions?
A
8
B
4
C
64
D
16

Correct : b

The processor uses a 16-bit (2-byte) instruction format with 16 registers, so each register field needs 4 bits. Variable-sized opcodes mean unused opcode space at one level can be extended to the next level by adding more bits.
First, figure out how many bits each instruction type leaves for the opcode:
M-type has 2 register fields (4+4 = 8 bits) and a 6-bit immediate, totalling 14 bits of operands. This leaves 16 − 14 = 2 bits for the opcode. So M-type opcodes are 2 bits wide, giving 22 = 4 possible M-type opcodes. Only 2 are used, leaving 2 unused 2-bit prefixes.
R-type has 3 register fields (4+4+4 = 12 bits) of operands, leaving 16 − 12 = 4 bits for the opcode. R-type opcodes are 4 bits wide. To avoid conflicting with M-type''s 2-bit opcodes (00 and 01), R-type must use the 2 remaining 2-bit prefixes (say 10 and 11) and extend each to 4 bits. This gives 2 × 22 = 8 possible R-type opcodes. We need 7, so both unused M-type prefixes are consumed for R-type, and only 1 out of 8 R-type slots remains unused.
C-type has 1 register field (4 bits) and a 6-bit offset, totalling 10 bits of operands, leaving 16 − 10 = 6 bits for the opcode. C-type opcodes are 6 bits wide. The only space left is the 1 unused 4-bit R-type prefix, which can be extended by 2 more bits to form 6-bit C-type opcodes. This gives 1 × 22 = 4 possible C-type opcodes.
Correct answer: B — 4 ✓

Similar Questions

Consider a system with 2KB direct mapped data cache with a block size of 64bytes. The system has a physical address space of 64KB and a word length of 16bits. D...
#316 MSQ
Consider the given C-code and its corresponding assembly code, with a few operands U1-U4 being unknown. Some useful information as well as the semantics of each...
#976 MCQ
A 4 kilobyte (KB) byte-addressable memory is realized using four 1 KB memory blocks. Two input address lines (IA4 and IA3) are connected to the chip select (CS)...
#977 MCQ

Related Topics

variable opcode instruction format GATE 2026 GATE CS 2026 Set-2 Q44 M-type R-type C-type opcode GATE 2-byte instruction variable opcode computer organization GATE 2026 maximum unique C-type opcodes GATE expanding opcode technique GATE

Unique Visitor Count

Total Unique Visitors

Loading......