A computer has 32-bit instructions and 12-bit addresses. Suppose there are 250 two-address instructions. How many one-address instructions can be formulated? Explain your answer.
Two address instructions are of the form:
$OPCODE$ $ADDRESS$ $ADDRESS$
One address instructions are of the form:
$OPCODE$ $ADDRESS$
The solution provided is:
There are 250 2-address instructions. There are only a total of 256 2-address instructions
allowed if we have 32-bit instructions (two addresses take up 24 bits, leaving only 8 bits for
the opcode). Looking at the 8 bit opcode, assume bit patterns 00000000 (0) through
11111001 (249) are used for the 250 two-address instructions. Then there are 6 bit
patterns left for one address instructions. However, each one of these can use the
remaining 12 bits gained from having only one operand, so we have $6 * 2^{12}$.
I dont understand the part starting from "However, each one of these can use the remaining 12 bits gained from having only one operand, so we have $6 * 2^{12}$."
According to me, each of those 6 bit patterns should be able to use 20 bits (32-12) but this gives incorrect answer. So whats wrong with my reasoning? Also according to the given solution total instructions comes out to be $6 * 2^{12} + 250$ which is far lesser than $2^{32}$. What are the remaining bits used for? Sorry if this is a stupid question but I just couldnt understand it even after lot of attempts.