retagged by
2,987 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

0 votes
0 votes
1 answer
1
Subbu. asked Aug 3, 2022
341 views
How to implement indirect addressing mode using register indirect addressing mode???