1,843 views
4 votes
4 votes
A register to register machine support two address one address and zero address instruction. Instruction register size is 24bits and register set size is 480.

If there are 48 two address instruction and 2048 zero address instruction then what is the maximum possible number of one address instruction?

3 Answers

Best answer
4 votes
4 votes

Here the keyword to be noticed is : "register to register instruction" . Hence address refers to register set here instead of memory location and hence defined by register size .

Given register size      =      480 registers

Hence number of bits needed to address these registers   =    ceil(log2 (number of registers))

                                                                                    =    ceil(log2 480)

                                                                                    =    9

Hence in a 2 address instructions , number of bits remaining for opcode   =   24 - 9 - 9    =    6 bits

Hence number of instructions = number of opcodes          =    26             =   64 instructions

But given number of 2 address instructions                      =    48.

Hence number of unused opcodes                                   =    64  -  48    =   16 

So this opcodes along with next 9 bits of address will be used to generate one address instructions using expanded opcode technique.

Hence number of one address instructions possible          =    16 * 29  [ As there are 29 combinations possible as we have taken 9 bits of address field of 2 address instruction for each of its unused opcode ]

Now for zero address instructions , let number of unused opcode   =   x  

Then , similar to above for each opcode we have 29 combinations from the bits of the address field of the 1 address instruction.

Hence number of zero address instructions   ==>    x * 29   =    2048 [ Number of zero address instructions given in question ]

                                                                 ==>    x          =    4

Hence number of opcodes used in one address instructions      =    16 * 29  -   x   =   16 * 29  -   4

                                                                                                                       =    8188

Hence number of 1 address instruction in this scenario possible     =     8188

                   

selected by
1 votes
1 votes
Number of bits required to identify register is 9 bits

$2^{24}-(48*2^{18}+2048)/2^{9}$=
1 votes
1 votes
This Computer supports 2 Address, 1-Address ,Zero Instruction instructions.

Instruction register size =24 bit

Register Set size = 480 = 2^9 = 9 bits  needed to address these registers

Address 1 = 9 bit Address 2 = 9bit

Opcode = 24-(9+9) =6 =2^6 =64 instructions are possible.

48 2- Address Instruction then 64-48 = 16, then 1 Address be 16(2^9).

Now for Zero address instructions, let x be a number of unused opcode = 2^9*x = 2048, x =4

Number of Opcodes used in 1 Address instruction = 16 *2^9 -4 =8188
edited by

Related questions

520
views
1 answers
1 votes
rfzahid asked Mar 15, 2018
520 views
Suppose that in $500$ memory references there are $50$ misses in the first level cache and $20$ misses in the second level cache. Assume miss penalty from the ... $5$15$\text{None of these}$
200
views
0 answers
0 votes
Prince Sindhiya asked Jan 2, 2019
200 views
Consider the following Synchronization mechanism implemented by Process A and Process B.Process AA1. flag_A = true;A2. while (flag_B) = = true)do nothing;A4. ... the above i am getting both but answer is ME only not progress plz check
953
views
1 answers
0 votes
rfzahid asked Dec 12, 2017
953 views
Consider the following set of propositions:I. I carry an umbrella only if it rains.II. If I carry an umbrella I use it.III. I get wet in rain only if I don't use ... ) I will get wet today.(C) I might get wet today.(D) None of the above.
657
views
1 answers
1 votes
rfzahid asked Dec 11, 2017
657 views
Ram draws an empty graph of 6 nodes and tosses a fair die for every pair of distinct nodes, if a prime number occurs he draws an edge between the respective pair otherwise he moves on ... degree 2?(a) 5/16(b) 1/2(c) 3/8(d) None of the above