edited by
455 views
2 votes
2 votes

Consider a system that supports 2-address, 1-address, and 0-address instructions. The system has 'i' bits instructions and 'a' bits addresses. If there are 'x' 2-address instructions and 'y' 1-address instructions then which of the following is the maximum number of 0-address instructions supported by the system?

  1. $2 ^ i - 2 ^ a * x - y$
  2. $2 ^ i - 2 ^ {2a} * x - y$
  3. $2 ^ i - 2 ^{2a} * x - y * 2 ^ a$
  4. $2 ^ i - 2 ^ a * x - y * 2 ^ a$
edited by

1 Answer

2 votes
2 votes
$i$ bits $(0/1)$ are used for an instruction. So, total number of encodings possible $=2^i.$

The address bits are part of instruction bits. For $1-$address instructions there are $a$ address bits and for $2-$ address instructions there are $2a$ address bits.

So, $y$ one address instructions will take $y \times 2^{a}$ encodings (address change won’t count as a new instruction) and

$x$ two address instructions will take $x \times 2^{2a}$ encodings.

So, remaining encodings (which are free for $0-$ address instructions) $ = 2^i – (y \times 2^a) –( x \times 2^{2a})$
Answer:

Related questions

0 votes
0 votes
0 answers
2