Week 9 Computer Architecture chirag.docx - P1 Given the...

This preview shows page 1 - 9 out of 23 pages.

P1: Given the following memory values and a one-address machine with an accumulator,what values do the following instructions load into the accumulator?Word 20 contains 40. Word 30 contains 50. Word 40 contains 60. Word 50 contains 70. a. LOAD IMMEDIATE 20 b. LOAD DIRECT 20 c. LOAD INDIRECT 20 d. LOAD IMMEDIATE 30 e. LOAD DIRECT 30 f. LOAD INDIRECT 30Ans.Value load by Instructions:Given dataWordData2040305040605070a.LOAD IMMEDIATE 20:Instruction itself contains immediate value 20Operand = 20
Thus, Load immediate 30 results with data 20.b.LOAD DIRECT 20 Loads the value which is present in the address 20, from the given data word 20 containsdata 40.Thus, Load direct 20 results with fetching data 40.c.LOAD INDIRECT 20 In Indirect addressing, address of the data is held in intermediate location. Word 20 contains 40.Word 40 acts as address for data 60.
Thus, Load indirect 20 results with fetching data 60.d.LOAD IMMEDIATE 30 Instructions itself contains immediate value 30.Operand = 30Thus, Load immediate 30 results with the data 30.e.LOAD DIRECT 30 Loads the value which is present in the address 30, from the given data word 30 containsdata 50.
Thus, Load direct 30 results with fetching data 50.f.LOAD INDIRECT 30In Indirect addressing, address of the data is held in intermediate location. Word 30 contains 50.Word 50 acts as address for data 70.
Thus, Load direct 30 results with fetching data 70.P2: Consider a 16-bit processor in which the following appears in main memory, starting atlocation200Loadto ACMode201500202Nextinstruction
first part of the first word indicates that this instruction loads a value into an accumulator.The Mode field specifies an addressing mode and, if appropriate, indicates a sourceregister; assume that when used, the source register is R1, which has a value of 400. Thereis also a base register that contains the value 100. The value of 500 in location 201 may bepart of the address calculation. Assume that location 399 contains the value 999, location400 contains the value 1000, and so on. Determine the effective address and the operand tobe loaded for the following address modes:a. Direct b. Immediate c. Indirect d. PC relative e. Displacement f. Register g. Register indirect h. Autoindexing with increment, using R1Ans.Given Data:Source register R1 holds the value 400.Base register used as displacement contains value 100.Value 500 is stored in address 201.Value 999 is stored in address 399.Value 1000 is stored in address 400.
The value 500 is considered as Offset address in all the cases and has been explained.a.Effective address and operand to be loaded using direct addressing Mode:Using the above given data with direct addressing mode, we have the effective address as“500” and the operand to be loaded as “1100”
Explanation:Direct addressing is a kind of addressing technique in which address field holds“Effective address of the Operand”In the address Location “400” there is value of “1000”, address “401” consists of “1001”,address “402” consists of “1002” and so on. In the given data address “X” Consists ofvalue address “X+600”. For example, address 403 consists value of “403+600 = 1003”

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture