August
1999 QUESTION 2 Total Marks: 20 Marks |
Click here to access other
questions
Click to access |
(a) | An instruction word has two components. Name
them, and explain the use of each.
|
[2] |
(b) | The length of an instruction word affects many
aspects of the system, both hardware and software. Briefly describe three of the effects
that varying instruction sizes have.
|
[6] |
Consider a set of
four processors P0, P1, P2, and P3, where Pi is an i-address machine. P0 is a zero-address
stack machine, while P1, P2, and P3 are conventional computers each with 16
general-purpose registers R0-R15 for data and address storage. All four processors have
instructions with the (assembly language) opcodes ADD, SUB, MUL, and DIV to implement the
operations +, - , * and / respectively.
|
||
(c) | Using as few instructions as you can, write a
program for each of the four machines to evaluate the following arithmetic expression :
|
[8] |
(d) | Assuming that the only instructions are those
which you have used, and that all addresses are 8 bits long, calculate the total
object-program size in bits for your programs for P1, Pr2, and P3. State any additional assumptions you make.
|
[4] |