• retagged by
1,103 views
2 2 votes
Consider a hypothetical processor that supports two addresses -- one address and zero address instructions. It has a $256$ word memory, and a $20$ bit instruction is placed in $1$ word of memory (where memory is word addressable).

If there exist $8$ two address instructions and $1984$ one address instructions, then the total number of zero address instructions formulated are _______.

3 Answers

Best answer
5 5 votes
With 20 bits, number of encodings = $2^{20}$ (Not all of these are distinct instructions as when only address bits differ, instructions are not distinct).

No. of address bits for one address = 8 as memory is 256 words and word addressable.

No. of encodings taken by 8 two address instructions $= 8 \times 2^{8} \times 2^8=2^{19}$.

No. of encodings taken by 1984 one addressable instructions $= 1984 \times 2^8$.

Remaining encodings can become possible 0 address instructions which is

$2^{20} - 2^{19} - 1984 \times 2^{8} \\= 2^{19} - 2^{18} -960 \times 2^8 \\= 2^{18} - 960 \times 2^8 \\= 64 \times 2^8 \\= 2^{14} \\= 16384$
• selected by
3 3 votes
256 words = 2^8 words , Hence 8 bits for address
With 4 bit opcode, we can have 16 operations but only 8, 2-add operations are used, so possible 1-address instructions (16 - 8 )* 2^8  = 2^11  instructions
Now possible 0-address instructions = ( 2^11 −  1984 )* 2^8 = 64 × 2^8 = 2^14 = 16,384
1 1 vote

20 bit instructions. => $2^{20}$ different encodings or formulations of instructions possible.

Already explained the difference between an instruction and an instruction encoding here.

An address = 8 bits (because 256 word memory)

=> The "operand" field in the instruction format takes 8 bits.

 

there exist 8 two address instructions

Two address instructions == Two operand instructions.

So, $2^{16}$ different combinations of two operands possible, since an operand is of 8 bits.

These $2^{16}$ different operand combinations can be clubbed with 8 different types of instructions.

So, total encodings = $8 * 2^{16}$

 

1984 one address instructions

Similarly; $1984*2^8$ encodings possible for this one.

 

So, out of total possible encodings, 1AI and 2AI take $8 * 2^{16}+1984*2^8$ encodings.

= $2^{19}+507904=1032192$ encodings

 

Remaining encodings = $2^{20}-1032192=16384$

Answer:
Position:
Show:

Related questions

4 4 votes
3 answers 3 answers
1.6k
1.6k views
Bikram asked Nov 25, 2016
1,578 views
A computer has $32$ bit instructions and $12$ bit addresses.If there are $250$ two-address instructions, the number of one-address instructions that can be formulated are...
0 0 votes
1 answers 1 answer
644
644 views
Bikram asked Nov 25, 2016
644 views
The memory unit of a computer has $256$ K words of $32$ bits each. The computer has an instruction format with four fields: an operation code field, a mode field (to spec...
1 1 vote
3 answers 3 answers
913
913 views
Bikram asked Nov 25, 2016
913 views
Consider the following program segment for a CPU having three Registers $R1, R2,$ and $R3$:$$ \begin{array}{|l|l|l|} \hline \text{Instruction} & \text{Operation} & \text{...
1 1 vote
1 answers 1 answer
747
747 views
Bikram asked Nov 25, 2016
747 views
Consider two pipelines A and B. Pipeline A has $8$ stages with uniform stage delay of $2$ns. Pipeline B has $5$ stages with uniform stage delays of $3$ns. Time saved (in ...