retagged by
3,141 views
1 votes
1 votes
Consider a hypothetical CPU which supports 16 bit instruction, 64 registers and 1 KB memory space. If there exist 12 2-address instruction which uses register reference and 12 1-address memory reference instructions how many O-address instructions are possible?
retagged by

3 Answers

Best answer
4 votes
4 votes

|-------------------------------------------------16 bits-------------------------------------------------------|

Opcode ( 4 bits) Register (6 bits ) Register (6 bits )

so that Total no of opcode operation is =2^4=16 operation 

so that there exist 12 2's address instruction which uses the register reference  & 12 1-address memory reference instructions

then no of Free opcode operation after 2 address =16-12=4 

then no of   12 1-address memory reference instructions

4

|---------------------------------------------16 bits ------------------------------------------------------------| 

opcode  memory 

|-----------------6 bits --------------------------------|--------------------10 bits ---------------------------|

Memory 1 kb = 2^10 ( 10 bits for memory ) ( 16 -10=6 bits for opcode)

then no of opcode  bits for 1 address for the memory reference  (6-4 =2 bits )

((2^4-12)*2^2-12)*2^10 = 4096 O-address instructions are possible

how many =4096 

edited by
7 votes
7 votes
Total encodings$=2^{16}$

Number of encodings used in $12$ two address instructions$=12*2^6*2^6$

Number of encodings used in $12$ one address memory reference instructions$=12*2^{10}$

The number encodings left for zero address instructions/ number of zero address instructions possible$=2^{16}-(12*2^6*2^6+12*2^{10})=4096$
1 votes
1 votes

This is the method ..

Related questions

359
views
1 answers
0 votes
Subbu. asked Aug 3, 2022
359 views
How to implement indirect addressing mode using register indirect addressing mode???
155
views
0 answers
0 votes
ENTJ007 asked Apr 18
155 views
Design a vertical micro programmed control unit to generate 40 signals. Out of first 35 those only 3 signals can be active at a time. And remaining 5, anyone can be acti...
2.0k
views
1 answers
2 votes
Arjun asked Feb 16
1,997 views
A processor with $16$ general purpose registers uses a $32$-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two regi...
2.1k
views
0 answers
2 votes
Arjun asked Feb 16
2,096 views
A non-pipelined instruction execution unit operating at $2 \mathrm{GHz}$ takes an average of $6$ cycles to execute an instruction of a program $\text{P}$. The unit is the...