I was given three types of instruction, Type A, B, C which has 4, 7, 8-bit opcode respectively. What is the maximum total number of instructions if all three types of instructions exist? The answer for this question is 240 total instructions.
However, I only managed to get a max instructions of 233 by giving Type A the opcode of 0000 and giving the first four bits of Type B 0001, while the remaining combinations of 4 bits to Type C. The total would be 1 (Type A) + 2^3 (Type B) + (2^4 - 2)(2^4) (Type C) = 233 instructions.
Just to clarify, 2^3 is derived from the remaining 3 bits of Type B. And 2^4 is the remaining 4 bits of Type C.