5,097 views
3 votes
3 votes
A computer system supports 1-address instructions and 2-address instructions and word size is 16 bits. Main memory is 64 words. If there are eight 2 -address instructions then how many 1-address instructions are used?

3 Answers

Best answer
7 votes
7 votes

Address size=6 bits

For 2address instructions, 

16-2*6=4 that means 2^4 opcodes

Opcodes remaining after 2 addr instructions =8

Total one addr instructions(after combining 6  address bits to instruction   opcode-expand technique )  =8*2^6=512 instructions 

selected by
1 votes
1 votes

Size of Main Memory is 64 words i.e 2^6  ,So out of 16 bits 6 bits for Address and 10 bits for Opcode in 1-add format , total one add

instruction = 2^10= 1024. 

Since there are two 2 add instructions , so again from 10 bits of opcode , 6 bits will be taken out, so remaining 4 bits will be left for opcode.

Now , to accomodate two 2 add instructions 2^6 one add instructions are to be satisfide,

so ,valid 1 add inst + non valid 1 add inst= total 1 add inst

     valid1 add inst= 2^10 - 2* 2^6 = 1024-128= 896.

0 votes
0 votes
No. of encoding possible = $2^{16} = 65536$

Main memory has 64 words that means 64 words can be addressed so we use $\left \lceil log_2(64) \right \rceil = 6\ bits$

no. of encoding for 2 address instructions = $8 \times 2^6 \times 2^6 = 32768$

No. of encodings left = $65536 - 32768 = 32768$

Number of 1 address instructions = $\frac{32768}{2^6}=512$ instructions

Related questions

1 votes
1 votes
1 answer
3
isriram asked Jun 9, 2022
1,094 views
Consider a system which supports only 1-address type instructions. The size of memory the system has is $2^m$ KB. The system supports ' i ' distinct instructions. The len...
0 votes
0 votes
2 answers
4