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?
We are given a processor with 16 general purpose registers and a fixed 2-byte (16-bit) instruction format, where opcodes can have variable length as long as the encoding stays uniquely decodable.
Step 1: Bits needed to address a register.
Since there are 16 registers, each register operand needs \(\log_2 16 = 4\) bits.
Step 2: Bits consumed by operands of each instruction type.
M-type: 2 register operands + 6-bit immediate = \(2 \times 4 + 6 = 14\) bits.
So the opcode field for M-type = \(16 - 14 = 2\) bits.
R-type: 3 register operands = \(3 \times 4 = 12\) bits.
So the opcode field for R-type = \(16 - 12 = 4\) bits.
C-type: 1 register operand + 6-bit offset = \(4 + 6 = 10\) bits.
So the opcode field for C-type = \(16 - 10 = 6\) bits.
Step 3: Why the opcodes must be prefix-free.
Since the total instruction is always exactly 16 bits but the opcode length differs by type (2, 4, or 6 bits), the decoder identifies the instruction type purely by reading the opcode bits one at a time. This is only possible if no valid opcode is a bit-prefix of another valid opcode of a different length -- exactly like a Huffman / prefix code tree.
Step 4: Build the prefix-code tree level by level.
At the 2-bit level there are \(2^2 = 4\) possible codes. M-type uses 2 of them, leaving 2 codes unused at this level. These 2 unused 2-bit codes are the only ones that can be extended further (used codes cannot be extended, or they would no longer be prefix-free).
Step 5: Expand to the 4-bit level.
Each unused 2-bit code can be extended by 2 more bits, giving \(2^2 = 4\) children each. So the 2 unused 2-bit codes give \(2 \times 4 = 8\) available 4-bit codes. R-type uses 7 of these 8, leaving exactly 1 unused 4-bit code.
Step 6: Expand to the 6-bit level.
That single unused 4-bit code can be extended by 2 more bits, giving \(2^2 = 4\) children at the 6-bit level. These 4 codes are exactly the opcode space available for C-type instructions.
Step 7: Conclusion.
The maximum number of unique C-type opcodes possible is \(\boxed{4}\), which corresponds to option (B).
A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?

Match each addressing mode in List I with a data element or an element of a data
structure (in a high-level language) in List II:
List I
List II
P. Immediate
1. Element of an array
Q. Indirect
2. Pointer
R. Base with index
3. Element of a record
S. Base with offset/displacement 4. Constant
Consider the 8-bit signed integers 𝑋, 𝑌 and 𝑍 represented using the sign-magnitude
form. The binary representations of 𝑋 and 𝑌 are as follows:
𝑋: 10110100 𝑌: 01001100
Which of the following operations to compute 𝑍 result(s) in an arithmetic
overflow?
In a system, numbers are represented using 4-bit two’s complement form. Consider
four numbers 𝑁1 =1011, 𝑁2 =1101, 𝑁3 =1010 and 𝑁4 =1001 in the system.
Which of the following operations will result in arithmetic overflow?
The 32-bit IEEE 754 single precision representation of a number is 0xC2710000.
The number in decimal representation is ________. (rounded off to two decimal
places)
Consider the following two statements about interrupt handling mechanisms in a
CPU.
S1: In non-vectored interrupt mechanism, it usually takes more time to start the
Interrupt Service Routine (ISR) when compared to that in a vectored interrupt
mechanism.
S2: In daisy-chain interrupt mechanism, the CPU polls all the input devices
individually to determine the source of the interrupt.
Which one of the following options is correct with respect to S1 and S2 ?