SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Linda Null ,julia Lobur
Chapter:
A Closer Look At Instruction Set Architectures
Exercise:
Exercises
Question:7 | ISBN:9780763704445 | Edition: 3

Question

7. A computer has 32-bit instructions and 12-bit addresses. Suppose there are 250 2-address instructions. How many 1-address instructions can be formulated? Explain your answer.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

In a computer with 32-bit instructions and 12-bit addresses, we can determine the number of 1-address instructions that can be formulated based on the given information.

For 2-address instructions, each instruction requires two addresses: one for the source operand and one for the destination operand. Since the addresses are 12 bits each, the total number of 2-address instructions that can be formulated is given by:

Number of 2-address instructions = 2(2 * 12) = 224 = 16,777,216

 

Now, let's determine the number of 1-address instructions. In a 1-address instruction, there is one address used for both the source and destination operands. Since the computer has 32-bit instructions, we can consider the address field to be 32 bits long.

The total number of possible addresses that can be represented by 32 bits is given by:

Number of addresses = 232 = 4,294,967,296

However, we need to account for the fact that the address field in a 1-address instruction can only accommodate 12 bits. So, the number of 1-address instructions that can be formulated is limited by the number of possible 12-bit addresses within the 32-bit address space.

Number of 1-address instructions = 2(1 * 12) = 212 = 4,096

 

Hence, in a computer with 32-bit instructions and 12-bit addresses, if there are 250 2-address instructions, it is possible to formulate 4,096 1-address instructions.

0 0

Discussions

Post the discussion to improve the above solution.