retagged by
2,119 views
4 votes
4 votes

A hypothetical processor supports two-address, one-address and zero-address instructions. It has a 256 word memory and each instruction is 19 bits long. If there are 4 two-address instructions and 1000 one-address instructions, how many zero-address instructions are there?( Marks: 0.00 )

  1.   5126
  2.   2048
  3.   1024
  4.   6144
retagged by

2 Answers

Best answer
3 votes
3 votes
Explanation:
Since it is a 256 (= 2^8) word memory the no. of bits needed to address the memory = 8

Since each instruction is of length 19-bits, a two-address instruction can be divided as 8+8+3 where 8 bits for 1st-address , 8 bits for 2nd-address and 3-bits for opcode.

Also with 19 bits for an instruction giving 2^19 possible encodings.

It is given there are 4 two-address instructions, so no. of encodings for two-address instructions = 4 * 2^8 * 2^8 = 4*2^16

Also there are 1000 one-address instructions, so no. of encodings for one-address instructions = 1000 * 2^8

Then total number of possible 0-address instructions = 2^19 - (4*2^16 + (1000 * 2^8) )

= 2^8 * (2^11 - 4*256 - 1000)
= 2^8 *(2048-2024)
= 256*24
= 6144
selected by
0 votes
0 votes
4th that 6144 is the answer...

total number of zero address instructions possible....

2^19=524288....

now for creation of 1 address and 2 address we will eat up bits from o address instruction...

now 1 address instruction will eat up combinations =1000*(2^8)...reason = 1 address contain one memory refrence...so 8 bits for one refrence...such thousand instructions are needed...so we get it as 1000*(2^8)=256000....

now 2 address instructions...same as above....4*(2^16)=262144.....

hence remaining zero address=524288-256000-262144..=6144..

Related questions

1 votes
1 votes
1 answer
2
isriram asked Jun 9, 2022
1,141 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
0 answers
4
kanakjyoti asked Sep 1, 2022
240 views
Disadvantages of using 2-address instruction in place of 1-address instructions is/are?More memory required for programLarger sized instructionsMore number of instruction...