28
Computer Science & Telecommunication Engineering WELCOME TO OUR PRESENTATIO N 06/20/2022 1

ADDRESSING MODE

Embed Size (px)

DESCRIPTION

This presentation is the topic of computer architecture

Citation preview

Page 1: ADDRESSING MODE

Computer Science & Telecommunication Engineering

WELCOME TO OUR

PRESENTATION

04/13/2023 1

Page 2: ADDRESSING MODE

Presentation On

Define Addressing

Mode

&

Different Types of addressing

mode with numerical example

04/13/2023 2

Page 3: ADDRESSING MODE

Prepared By

04/13/2023 3

NAME IDIsrat Jahan Mishu BKH1201028F

Asma Anika Shahabuddin BKH1201043F

Parmita Dewanjee Shalu BKH1201040F

Page 4: ADDRESSING MODE

ADDRESSING MODESThe way the operands are chosen during program execution is dependent on the addressing mode of the instruction. The addressing mode specifies a rule for interpreting or modifying the address field of the instruction before the operand is actually referenced. Computers use addressing mode techniques for the purpose of accomodating one or both of the following:

04/13/2023 4

Page 5: ADDRESSING MODE

Computers use addressing mode techniques for the purpose of accomodating one or both of the following:

TO give programming versatility to the user by providing such facilities as pointers to memory,counters for loop control,indexing of data,and program relocation.

To reduce the number of bits in the addressing field of the instruction.

04/13/2023 5

Page 6: ADDRESSING MODE

Implied mode

Immediate mode

Register mode

Register indirect mode

Autoincrement or Autodecrement mode

Direct address mode

Indirect address mode

Relative address mode

Indexed addressing mode

Base register addressing mode

DIFFERENT TYPES OF ADDRESSING MODES

04/13/2023 6

Page 7: ADDRESSING MODE

Implied Mode

In this mode the operands are specified implicitly in the defination of the instruction.

For example, the instruction “complement accumulator” is an implied-mode instruction.

04/13/2023 7

Opcode Mode Address

Fig: Instruction format with mode field

Page 8: ADDRESSING MODE

Immediate Mode

In this mode the operand is specified in the instruction itself.

In other words, an immediate-mode instruction has an operand field rather than an address field.

04/13/20238

Page 9: ADDRESSING MODE

Immediate-mode instructions are useful for initializing registers to a constant value.

The operand field contains the actual operand to be used in conjunction with the operation specified in instruction.

04/13/2023 9

Page 10: ADDRESSING MODE

Register Mode

In this mode the operands are in registers that reside within the CPU.

The particular register is selected from register field in the instruction.

A k-bit field can specify any one of 2ᴷ registers

04/13/2023 10

Page 11: ADDRESSING MODE

REGISTER

INDIRECT

MODE

In this mode the instruction specifies a register in the CPU whose contents give the address of the operand in memory.

In other words, the selected register contains the address of the operand rather than the operand itself.

04/13/2023 11

Page 12: ADDRESSING MODE

The advantage of a register indirect mode a instruction is that the address field of the instruction uses fewer bits to select a register than would have been required to specify a memory address directly

04/13/2023 12

Page 13: ADDRESSING MODE

AUTOINCREMENT OR AUTODECREMENT MODE:

This is similar to the register indirect mode except that the register is increment or decrement after (or before) its value is used to access memory.

When the address stored in the register refers to a table of data in memory,it is necessary to increment or decrement the register after every access to the table.

04/13/2023 13

Page 14: ADDRESSING MODE

However, because it is such a common requirement. Some computers incorporate a special mode that automatically increments or decrements the content of the register after data access.

04/13/2023 14

Page 15: ADDRESSING MODE

DIRECT ADDRESS MODE

Is this mode the effective address is equal to the address part of the instruction.

The operand resides in memory and its address is given directly by the address field of the instruction.

In a branch-type instruction the address field specifies the actual branch address.

04/13/2023 15

Page 16: ADDRESSING MODE

INDIRECT ADDRESS MODE

In this mode the address field of the instruction gives the address where the effective address is stored in memory.

Control fetches the instruction from memory and uses its address part to access memory again to read the effective address.

04/13/2023 16

Page 17: ADDRESSING MODE

A few addressing modes require that the address field of the instruction be added to the content of a specific register in the CPU.

The effective address in these modes is obtained from the following computation:

Effective address=address part of instruction + content of CPU register.

04/13/2023 17

Page 18: ADDRESSING MODE

RELATIVE ADDRESS MODE

In this mode the content of the program counter is added to the address part of the instruction in order to obtain the effective address.

The address part of the instruction is usually a signed number which can be either positive or negative.

04/13/2023 18

Page 19: ADDRESSING MODE

When this number is added to the content of the program counter , the result produces an effective address whose position in memory is relative to the address of the next instruction.

It results in a shorter address field in the instruction format since the relative address can be specified with a smaller number of bits required to designate the entire memory address.

04/13/2023 19

Page 20: ADDRESSING MODE

INDEXED ADDRESSING MODE

In this mode the content of an index register is added to the address part of the instruction to obtain the effective address.

The index register is a special CPU register that contains an index value.

04/13/2023 20

Page 21: ADDRESSING MODE

The address field of the instruction defines the beginning address of a data array in memory.

Each operand in the array is stored in memory relative to the beginning address.

04/13/2023 21

Page 22: ADDRESSING MODE

BASE REGISTER ADDRESSING MODE

In this mode the content of a base register is added to the address part of the instruction to obtain the effective address.

This is similar to the indexed addressing mode except that the register is now called a base register instead of an index register.

04/13/2023 22

Page 23: ADDRESSING MODE

The base register addressing mode is used in computers to facilitate the relocation of programs in memory.

Only the value of the base register requires updating to reflect the beginning of a new memory segment.

04/13/2023 23

Page 24: ADDRESSING MODE

Numerical Example

To show the differences between the various modes, we will show the effect of the addressing modes on the instruction defined in fig:1. The two-word instruction at address 200 and 201 is a “load to AC” instruction with an address field equal to 500. The first word of the instruction specifies the operation code and mode, and the second word specifies the address part. PC has the value 200 for fetching this instruction. The content of the processor register R1 is 400,and the content of an index register XR is 100. AC receives the operand after the instruction is executed.

04/13/2023 24

Page 25: ADDRESSING MODE

Address Memory

PC=200

R1=400

XR=100

AC

Load to Ac Mode

Address=500

Next instruction

450

700

800

900

325

300

Figure: Numerical example for addressing modes

200

201

202

399

400

500

600

702

80004/13/2023 1

Page 26: ADDRESSING MODE

Addressing mode Effective Address Content of AC

Direct Address 500 800

Immediate operand

201 500

Indirect Address 800 300

Relative Address 702 325

Indexed Address 600 900

Register 400

Register Indirect 400 700

AutoIncrement 400 700Autodecrement 399 450

Table :Tabular List of Numerical Example04/13/2023 26

Page 27: ADDRESSING MODE

04/13/2023 27

Thanks To All

Page 28: ADDRESSING MODE

04/13/2023 28

Special Thanks To…………..

Our honourable SirAbul kalam Azad

Lecturer ,Dept. Of CSTENoakhali Science & Technology

University