April 1999
CS202: COMPUTER ARCHITECTURE AND DATA COMMUNICATION

QUESTION 5

Total Marks: 20 Marks

Click here to access other questions

GRADE A
Sample student's solutions are indicated in green.
Return to Question 5

 

(a) List two possible trade-offs we must take when employing various addressing methods in the design of an instruction set. [2]
  1. Address range.
  2. Number of memory references.

 

(b) With the aid of a diagram, briefly explain how the effective address is determined using the displacement addressing. [4]
There are 2 fields contain addressing information:
  1. The implicit field refers to special purpose register.
  2. The explicit field contains additional addressing.

Information is added into special purpose register to give effective address.

Base addressing is one of the example of displacement addressing.
In base addressing:

  • Special register is base register.
  • Base field provide storing address of segment of program.
  • Offset field provide displacement from segment.
  • To set effective address, offset in instruction is added with the base register.

 

(c) If the memory locations have contents as shown below before execution of the program. What values will they hold afterwards? Show your workings noting the value held in the accumulator and the addresses where a value is possibly changed.

pic4.gif (4560 bytes)

[8]
Load Immediate 20 Þ 20
Add Direct 40 Þ 20 + 20 = 40
Store Indirect 30 Þ 40
Load Direct 20 Þ 40
Add Direct 50 Þ 40 + 30 = 70
Store Indirect 10 Þ 70

 

Values afterwards
location value
10 30
20 40
30 70
40 20
50 30

 

(d) Although the following scenarios refer to people, money, buildings, etc., they can be regarded as examples of various addressing modes. For each one, explain which addressing mode it corresponds to. State clearly the reasons for your choice.

 

[6]
(i) A husband and wide have saved a considerable amount of money over a number of years. Not ones for trusting banks, they decide to deposit their money straight to a safe.
(ii) A young woman finds herself lost upon arriving in a new town applying for a job. To find the way, she first asks an old lady, who points her in the direction of an information board. The woman reads the board, and finds the location of the building she is looking for. She goes to the building and visits the company.
(iii) An old man searching for buried treasure has recently discovered the second half of the map which shows where the location of the gold is hidden. By taking his half and the newly discovered part of the map, a path to the location of the treasure is revealed to him.

 

(i) Immediate Addressing
When they kept the deposit by themselves, they can use the money straight away. They no need to contact the bank to take money. This is same as immediate addressing, where operand (a husband and wife) contain actual data (keep money themselves).

(ii) Indirect Addressing
A young woman set direction of an information board from old woman. However, the young woman cannot find the location, she need to find out by herself. This is the same as indirect addressing, where location printed by old woman is not the actual location, the young woman need to go to the location pointed by old woman to find out the actual location.

(iii)Displacement Addressing
To find out a path of location, the old man need to take the half and newly discovered part of the map. This is the same as displacement addressing, where offset value (newly discovered part of map) is added with the register value (first half of the map) in order to find out the effective address (location).