• edited by
759 views
1 1 vote

A processor has 16 registers and uses 16 -bit instruction format. It has two types of instructions:
Memory Type:
\begin{tabular}{|l|l|l|}
\hline Opcode & Register & 6 - bit memory address \\
\hline
\end{tabular}

ALU Type:
\begin{tabular}{|l|l|l|l|}
\hline Opcode & Destination Register & Source Register & Source Register $_{2}$ \\
\hline
\end{tabular}

If there are 2 distinct memory type opcodes (Load and Store), then the maximum number of distinct ALU type opcodes is $\qquad$ .

2 Answers

Best answer
3 3 votes

The system follows 16-bit instruction format & has 16 registers. So, in order to recognize 1 register

out of these 16 register, we need 4-bits.

It is mentioned that system has 2 type of instructions : Memory Type & ALU Type.

 

As, we have 16-bits, we can generate $2^{16}$ different combinations.

Now, these $2^{16}$, will gets distributed between Memory Type & ALU Type.

                  

For Memory Type :

 

           

 

As, it is saying that, there are 2 distinct memory type opcode : Store & Load. 

So, Under Memory Type, we need 1 -bit to recognize the opcode.

For register, we need 4-bit.

Then we need 6-bits for memory address.

 

For ALU Type :

 

       

 

1 ALU Instruction, need 1 Destination Register, Source Register 1, Source Register 2, each require 4-bit. 

Let, x be the number of operations that ALU can perform.

 

Now, 

$2^{11} + x * 2^{12} = 2^{16}$

Divide whole equation by $2^{11}$. We get,

1 + 2x = $2^{5}$

2x = 31 

x = 15.5.

As, the number of opcode can’t be in fraction. So, we will do lower bound, then we will get

x = 15. 

So, maximum number of distinct ALU opcode is 15(4-bits).

 

• selected by
3 3 votes
lets call memory type as M and ALU type as A
Since there are 16 registers, so 4 bits to represent a register in the instruction and memory addresses are 6 bit as given.
A → opcode size = 16 – (12) = 4 bit opcodes. Total $2^4 = 16$ opcodes possible. if x are taken, then 16-x are free.
M → opcode size = 16 – 10 = 6 bit opcode [out of these 4 bits come from free opcodes of type A ]
if 16-x are free in A type, then total opcodes of M type possible will be $(16-x)*2^2$ opcodes.

Since there are 2 M-type instructions in system, so $(16-x)*2^2$ is at least  2, this gives us $x<15.5$. That means number of taken A-type opcodes is less than 15.5, and since we want to maximize this we will to mark 15 A type opcodes as taken and 1 as free. So, this way 4 M-type opcodes will be possible and out of these 2 are used in system and 2 are free.

Answer : maximum 15 ALU-type opcodes
Position:
Show:

Related questions

1 1 vote
0 0 answers
321
321 views
Vishnu__ asked Jan 20
321 views
 Consider a processor with 30 general purpose registers and an instruction set size of 28. Each instruction has 4 fields as shown below Instruction CodeOperation | Source...
1 1 vote
2 2 answers
1.4k
1.4k views
none30 asked Sep 5, 2023
1,350 views
A system support zero address, one address & two address instructions. Let 16-bit instruction is stored in 128-word memory. Identify the correct among the following.(A) 1...
34 34 votes
3 answers 3 answers
15.2k
15.2k views
Arjun asked Feb 16, 2024
15,217 views
A processor with $16$ general purpose registers uses a $32$-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two regi...