retagged by
703 views

3 Answers

Best answer
6 votes
6 votes
32 bit instructions - totally $2^{32}$ possible encodings (encodings with only address part being different are not separate instructions).

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

Since nothing is given I assume no 0 address instructions and hence $2^{32} - 250 \times 2^{12} \times 2^{12}$ encodings are available for 1 address instructions. But of these $2^{12}$ of them are same due to address part. So, total number of 1 address instructions possible is

$\frac{2^{32} - 250 \times 2^{12} \times 2^{12}}{2^{12}} \\= 2^{20} - 250 \times 2^{12} \\= (250+6) \times 2^{12} - 250 \times 2^{12} \\= 6 \times 2^{12} \\= 2^{14}+ 2^13 \\= 16,384+8,192=24,576$
selected by
4 votes
4 votes
instruction is 32 bit , among them 8 bit opcode, 12 bit for address 1 , 12 bit for address 2 .
total 2^8 =256 combinations are there, among them 250 two address instructions , then 256-250= 6 combinations are used for one address instructions .
now  maximum number of one address instructions are 6* 2^12 = 24, 576
1 votes
1 votes
8 12 12
Opcode Operand1 Operand2

Opcode = 8bits because total size = 32bits.

 

Opcode specifies how many different operations can be performed. In Layman's terms, you can think that Opcode tells you how many different instructions can be there.

See the last part of the answer for difference between an instruction and an instruction encoding

Here, Opcode = 8bits => 256 different instructions can exist.

250 of those are already taken by 2 Add. Instructions. (binary operations)

 

Hence, we're left with just 6 different instructions for unary operations (ie 1 Address Instructions)

Here, in the operand field, we still get 12 bits. This means $2^{12}$ different operands can be fused with 6 different instruction formats.

=> Encodings possible = $6*2^{12}$

=> $24,576$ (Answer)

 


Instructions vs Instruction Encoding

An instruction is a command.
Like, multiply, add, move, load, store, increment.

An instruction encoding is the whole instruction specifically stated.
ie, multiply 2 and 3. Or, Load #666 in R2.

 

 instructions that can be formulated are

If I have one instruction, say, ADD and two 12-bit operands

I can formulate various instructions like:

  • 2 + 3
  • 99 + 75
  • 169 + 48

Each such "formulation" or an "instance" will be an encoding.

But all these are not distinct instructions because it's just addition.

 

Opcode specifies the type of instruction. Length of Opcode decides the number of instructions you can have.

Length of the whole instruction decides how many different formulations/encodings you can have.

Answer:

Related questions

483
views
3 answers
1 votes
Bikram asked Nov 25, 2016
483 views
Consider a hypothetical processor that supports two addresses -- one address and zero address instructions. It has a $256$ ... instructions, then the total number of zero address instructions formulated are _______.
300
views
1 answers
0 votes
Bikram asked Nov 25, 2016
300 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 specify one of ... $5,6,3,18$5,18,6,3$5,3,6,18$
428
views
3 answers
1 votes
Bikram asked Nov 25, 2016
428 views
Consider the following program segment for a CPU having three Registers $R1, R2,$ and $R3$ ... being executing by the CPU, then the return address saved onto the stack will be _______.
319
views
1 answers
1 votes
Bikram asked Nov 25, 2016
319 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$ ... in ns) by pipeline A compared to pipeline B to execute $100$ instructions is _____.