August
1997 QUESTION 4 Total Marks: 20 Marks |
Click here to access other
questions
Click to access |
4. | (a) Write programs to compute | [8] | |||||||||||||||||||||||||||||
X := (( A + B ) / ( C - D )) + ( E * F ) | |||||||||||||||||||||||||||||||
for 3-address and 1-address
machines with instructions sets as follows:
|
|||||||||||||||||||||||||||||||
(b) Suppose that the instructions shown above are the only instructions available on these machines, and suppose that all addresses/operands are 4 bits. What is the minimum size for the instructions of each of the two machines? | [4] | ||||||||||||||||||||||||||||||
(c) Use your answer to part (b) to calculate which of your two programs will occupy more storage space (in bits). Would the answer be different if addresses were 32 bits? | [4] | ||||||||||||||||||||||||||||||
(d) Which component within the CPU is used to process instructions such as ADD, SUB, MUL etc.? Give two other instructions which might also be processed by this component. | [4] |