In: Computer Science
In a computer instruction format, the instruction length is 12 bits and the size of an address field is 5 bits. The system architect has already designed three 2-address instructions and thirty one 1-address instructions. How many 0-address instructions can still be possibly accommodated?
Total Number of possible Instructions= 212=4096
size of address field = 5 bits.
There are 3 2-address Instruction, these 10 bits are used for
address & Remaining 2 bits are used to select one out of the 3
possible Instructions.
Total bit pattern needed= 3* 25*25
=3*210
=3*1024
=3072
For thirty-one 1-address instruction, bit Patton needed=31*25
=31*2*2*2*2*2
=31*32
=992
Total number of used bit patterns = 3072(3 2-address)+992(thirty
one 1-address)
=3072+992
=4064
Number of 0-address instructions possible=4096( Total Number of possible Instructions)-4064( Total number of used bit patterns)
=4096-4064
=32