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:11 | ISBN:9780763704445 | Edition: 3

Question

11. a) In a computer instruction format, the instruction length is 11 bits and the size of an address field is 4 bits. Is it possible to have

5 2-address instructions

45 1-address instructions

32 0-address instructions

using the format? Justify your answer.

b) Assume that a computer architect has already designed 6 two-address and 24 zero-address instructions using the instruction format given in Problem 11. What is the maximum number of one-address instructions that can be added to the instruction set?

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

a)

In a computer instruction format with an instruction length of 11 bits and a 4-bit address field, we can determine if it is possible to have the given number of instructions in each category:

  • 5 2-address instructions: Each 2-address instruction requires two address fields. With a 4-bit address field, we have a total of 4 bits available for addresses. Since each address field requires 4 bits, the maximum number of 2-address instructions that can be accommodated is (4 bits / 4 bits) = 1 instruction. Therefore, it is not possible to have 5 2-address instructions using this format.

  • 45 1-address instructions: Each 1-address instruction requires one address field. With a 4-bit address field, we can have a maximum of 41 = 4 different addresses. Therefore, it is not possible to have 45 1-address instructions using this format.

  • 32 0-address instructions: 0-address instructions do not require any address fields. Since the instruction format has an instruction length of 11 bits, it can accommodate any number of 0-address instructions as long as they fit within the 11-bit instruction length. Therefore, it is possible to have 32 0-address instructions using this format.

b)

If the computer architect has already designed 6 two-address instructions and 24 zero-address instructions using the given format, we can calculate the maximum number of one-address instructions that can be added:

  • Total number of instructions = Total instruction slots - Two-address instructions - Zero-address instructions
  • Total number of instructions = 211 (total possible instruction combinations) - 6 (two-address instructions) - 24 (zero-address instructions)
  • Total number of instructions = 2048 - 6 - 24
  • Total number of instructions = 2018

 

Hence, the maximum number of one-address instructions that can be added to the instruction set is 2018.

0 0

Discussions

Post the discussion to improve the above solution.