GIven instruction size = 1 memory word = 32 bits
No of bits needed to refer to a memory word = log2 (No of memory addresses/words)
= log2 (256K)
= 18 bits
No of bits needed to refer to processor registers = ceil ( log2 ( No of registers ))
= 6 bits
No of bits needed for addressing modes = ceil( log2 7 )
= 3 bits
Hence no of bits left for opcode = 32 - 18 - 6 - 3
= 5 bits...
All these PYQ blogs and standard videos blogs...