Here the thing worth watching is that in 2 address instructions , we have two types of address : register address for register set and memory address for memory word . And it is given that in 2 address instruction format , we will have opcode , then register address field then finally memory address field. So in generation of 1 address instruction using expanded opcode technique we will have memory based instruction as register address field will be merged with the unused opcodes of 2 address instruction. So the phrase "L register reference instruction" should be "L memory reference instruction" instead . Having said that :
Given register size = 100 registers
Hence number of bits needed to address these registers = ceil(log2 (number of registers))
= ceil(log2 100)
= 7
number of bits needed to address memory = ceil(log2(Memory capacity))
= ceil(log2(220))
= 20
Hence in a 2 address instructions , number of bits remaining for opcode = 32 - 7 - 20 = 5 bits
Hence number of instructions = number of opcodes = 25 = 32 instructions
But given number of 2 address instructions = K
Hence number of unused opcodes = 25 - K
So this opcodes along with next 7 bits of register address will be used to generate one address instructions using expanded opcode technique.
Hence number of one address instructions possible = ( 25 - K ) * 27 [ As there are 27 combinations possible as we have taken 7 bits of register address field of 2 address instruction for each of its unused opcode ]
Now given number of 1 address instructions = L
Hence number of unused opcodes for 0 address instruction = [ ( 25 - K ) * 27 - L ]
Now each of these opcodes will be merged with each of the 220 combinations as we have 20 bits in memory address field to form 0 address instructions .
Hence number of 0 address instructions = [ ( 25 - K ) * 27 - L ] * 220
Hence B) should be the correct option .