A processor uses a fixed-length 32-bit instruction format for a one address machine. The processor has 98 instructions.
a) Calculate the number of bits for opcode.
b) Calculate the number of bits for operand.
c) Calculate the maximum memory address that a program can in this machine can access.
d) Is it possible to expand the instruction set of this machine? Explain your answer
Instruction size = 32-bit
Number of instruction n = 98
a. number of bits for opcode
= "ceil\\left(\\log{n}\\right)"
= "ceil\\left(\\log{98}\\right)"
7 bits for opcode will be required
b.
number of bit in operand = (number of bit for instruction) - (bit required in opcode)
= "32 - 7 = 25"
= 25 bits
c.
since there is only one Address and operand bit in instruction are 25
"\\therefore maximum\\ memory\\ address\\ that\\ can\\ be \\ can\\ be\\ accessed \\ is\\ 2^{25}"
d.
yes it is because
In 7 bit opcode "2^7" = 128 instruction possible, but only 98 instructions are used in this set.
Total number of instruction may additionally use = "\\left(128\\ -\\ 98\\right)" "= 30"
Comments
Leave a comment