In a computer instruction form at the instruction length is
In a computer instruction form at, the instruction length is 12bits and the size of an address field is 4 bits. Is it possible to have:
13 2-address instructions
46 1-address instructions
30 0-address instructions
using the specified format? You must show
your design or argument to justify your
answer to get credit.
Solution
Instruction length =12 bits
size of 1 address field = 4 bits
1. 13 two address instruction
4 bits opcode 4 bits Address 1 4 bits Address 2
we are left with 4 bits for opcode . 4 bits can store 24 opcodes or 16 opcodes . So 13 opcodes can be easily accomodated. We can have 13 two address instructions.
2. 46 one address instructions
Out of 12 bits we require 4 bits for one address. We are left with 8 bits for opcodes. 8 bits can store 28 opcodes or 256 opcodes. So it is possible to have 46 one address instructions.
3. 30 0 address instructions
The 30 0 address instructions can be easily supported by the 12 bits instruction format as we do not require bits for address.
