in CO and Architecture
159 views
1 vote
1 vote
The format of a double operand instruction of a cpu consist of 4 bit op-code and 4 bits for source and destination. 12 double  operand instructions and 24 single operand instructions must be implemented. Op-code field mus identify three groups of n-operand instructions . What is the total number of zero operand instructions that can be implemented ?
in CO and Architecture
159 views

1 Answer

0 votes
0 votes

Number of operations possible = 2opcode = 24 =16

Here, address field value is 4 bits each for source and destination. So that makes instruction format as :

 opcode (4 bits)   Address field for source (4 bits)   Address filed for destination (4 bits)

<-------------------------------- 12 bits ------------------------------>

Number of 2 address instructions = 12

$\therefore$ Free combinations = 16 - 12 = 4

Now, we'll allocate memory for 1 address instructions

So, number of 1 address instructions possible = Free combinations * decoded value of address field

                                                                   = 4 * 24

                                                                                         = 64

But there are only 24 1 address instructions available, so the remaining must be allocated to 0 address instructions.

So, number of addresses free after allocation of 1 address instructions = 64 - 24 = 40

$\therefore$ Number of 0 address instructions possible = 40 * decoded value of address field

                                                                               = 40 * 24

                                                                                                         = 640

Note : In expand opcode technique, we always allocate space for higher addresses initially and then move on to the lower addresses.