32 bits long instruction size,
|Opcode|Reg bits| m/m address|
7 bits are needed for registers and 20 bits are needed for memory address, hence there will 5 bits for opcode.
total number of possible instructions which refer both memory and registers are $2^{5}=32$, ifthere are k such instructions then number of instructions which refer only registers will be
(32-k)*$2^{20}$ and if there are such l instructions then there will be 0-address instructions as
$((32-k)*2^{20} - l)*2^{7}$