0% found this document useful (0 votes)
24 views3 pages

Tushar Bhadane Assignment

This document contains answers to multiple questions about addressing modes and effective addresses. For the first question, the effective address is explained to be 600 based on indexed addressing with register R1 containing 200 as the index. For subsequent questions, the addressing modes of direct, immediate, relative, register indirect and indexed are defined, and effective addresses are calculated based on the given memory locations and values. It also provides the number of one-address instructions that can be encoded in a 32-bit instruction format.

Uploaded by

Anish Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Tushar Bhadane Assignment

This document contains answers to multiple questions about addressing modes and effective addresses. For the first question, the effective address is explained to be 600 based on indexed addressing with register R1 containing 200 as the index. For subsequent questions, the addressing modes of direct, immediate, relative, register indirect and indexed are defined, and effective addresses are calculated based on the given memory locations and values. It also provides the number of one-address instructions that can be encoded in a 32-bit instruction format.

Uploaded by

Anish Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Name :- Tushar Bhadane

22BCY10191

the effective address if the addressing mode of the instruction is (i) 400(ii) 301 (iii) 701
Ans1 :- (iv)200 (v) 600

Explanation:

Given: An instruction is stored at location 300 with its address field at location 301. The
address field at location 301. The address field has the value 400. A processor register r1
contains the number 200.

To find: Evaluate the effective address if the addressing mode of the instruction is (i)
direct (ii) immediate (iii) relative (iv)register indirect (v) index with r1 as the index register

Solution:

The description given in the assignment can be represented like this:

Location _ Contents

300 _ opcode ;the instruction operation code

301 _ 400 ;address field of the above instruction

(a) direct addressing

Direct addressing means that the address field contains the address of memory location
the instruction is supposed to work with (where an operand "resides").

Effective address would therefore be 400.

(b) immediate addressing

Immediate addressing means that the address field contains the operand itself.

Effective address would therefore be 301.

(c) relative addressing

Relative addressing means that the address field contains offset to be added to the program
counter to address a memory location of the operand.

Effective address would therefore be 301 + 400 = 701.

(d) register indirect addressing

Register indirect addressing means that the address of an operand is in the register. The
address field in this case contains just another operand.

Effective address would therefore be in R1 = 200.


An instruction is stored at location 500 with its address field at location 501. The address
Ans2:-
field has the value 300. A processor register R1 contains the number 100. Evaluate the
effective
address if the addressing mode of the instruction is : 1. Immediate 2. Direct 3. Register
Indirect
4. Relative 5. Index with R1 as the index register.

Ans 3:- The description given in the assignment can be represented like this:

Location _ Contents

300 _ opcode ;the instruction operation code

301 _ 400 ;address field of the above instruction

(a) direct addressing

Direct addressing means that the address field contains the address of memory location the instruction is
supposed to work with (where an operand "resides").

Effective address would therefore be 400.

(b) immediate addressing

Immediate addressing means that the address field contains the operand itself.

Effective address would therefore be 301.

(c) relative addressing

Relative addressing means that the address field contains offset to be added to the program counter to
address a memory location of the operand.

Effective address would therefore be 301 + 400 = 701.

(d) register indirect addressing

Register indirect addressing means that the address of an operand is in the register. The address field in
this case contains just another operand.

Effective address would therefore be in R1 = 200.

(e) indexed addressing with R1 as index register

There are several possible indexed addressing modes but in this case (tehre is an address field) it is co
called "indexed absolute" addressing.

In indexed absolute addressing the effective address is calculated by taking the contnts of the address field
and adding the contents of the index register.

Effective address would therefore be 400 + R1 = 400 + 200 = 600


Ans 4:- Number of one address instruction

• There are 250 2–address instructions.

• If we have 32–bit instructions allowed, then there are 256 2–address instructions only allowed (two
addresses will take 24–bits, leaving 8–bits for the opcode).

• Observing the 8–bit opcode, assume the bit pattern 00000000 (0) to the bit pattern 11111001 (249) are
utilized for the 250 2–address instructions.

• Then there are only 6–bit patterns left out for 1–one address instructions.

• Though, each one of these could use the remaining 12–bits attained from possessing only one operand,
thus we have 6 * 212 1–address instructions.

Ans 5:- (a) EA = 2000 + 12 = 2012


(b) EA = 2000 + 3000 = 5000
(c) EA = 2000 + 3000 + 28 = 5032

For 98 instructions, you need log2(98) = ~6.6 bits for opcode. Let's round it up to 7 bits. Since there are 10
Ans 6:-
addressing modes, you'd need log2(10) = ~3.3 bits for addressing mode. Let's round it up to 4 bits. So, opcode
bits = 7 and mode bits = 4.

You might also like