Justify whether it is possible to design an expanding opcode to allow the following to be encoded in 16-bit instruction? An address is 4 bits.
15 instructions with three addresses
14 instructions with two addresses
31 instructions with one address
18 instructions with zero address
For the first 15 instructions with 3 addresses
15×2^4×2^2×4= 61440 bit patterns
For the second 14 instruction with 2 addresses
14×2^4×2^4= 3584 bit patterns
For the third 31 instruction with address
31×2^4= 496 bit patterns
For the 18 instruction represents 18 bit patterns
Required bit pattern is 61440+3584+496+18= 65538
With 16 bit we can only have
2^16= 65536
Required bit pattern (65 538)is more than what we have (65 536) so it is not possible.
Comments
Leave a comment