Examples of Addressing Modes - 14.5 | 14. Handling Different Addressing Modes | Computer Organisation and Architecture - Vol 2
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

Interactive Audio Lesson

Listen to a student-teacher conversation explaining the topic in a relatable way.

Immediate Addressing Mode

Unlock Audio Lesson

0:00
Teacher
Teacher

Today, we're going to explore addressing modes, starting with immediate addressing. In this mode, the operand is included directly in the instruction. Can anyone give me an example of an instruction that uses this mode?

Student 1
Student 1

How about `LOAD R1, 32`? Here, `32` is used directly as the value.

Student 2
Student 2

So, it means we just load that value into `R1`, right?

Teacher
Teacher

Exactly! This instruction involves fewer steps since the operand is directly accessible. We only need to fetch the instruction and load the immediate value into the register. Can anyone recall how many steps this typically takes?

Student 3
Student 3

I think it takes four steps.

Teacher
Teacher

That's right! Four micro instructions for immediate addressing. Great job! Remember - MI for 'Immediate = 4 Instructions.' Let's move on to direct addressing.

Direct Addressing Mode

Unlock Audio Lesson

0:00
Teacher
Teacher

Now, let’s talk about direct addressing mode. Here, the operand’s address is given directly in the instruction. For example, `LOAD R1, M` where `M` is a memory location.

Student 1
Student 1

So, we fetch the instruction and then access the memory location to get the operand?

Teacher
Teacher

Exactly! And how many steps do you think are required for this process?

Student 2
Student 2

I remember it's six steps for direct addressing.

Teacher
Teacher

Correct! Direct addressing requires six micro instructions. To help you remember this, think: 'D6 for Direct = 6 Steps.'

Indirect Addressing Mode

Unlock Audio Lesson

0:00
Teacher
Teacher

Lastly, let’s delve into indirect addressing. In this mode, the operand's address is not specified directly; instead, it is found by first accessing another memory location.

Student 3
Student 3

So, if the instruction is like `LOAD R1, (M)`, it means we first read from memory location `M`, and then that gives us the actual memory address of the operand?

Teacher
Teacher

Correct! This requires two memory accesses. Can anyone tell me how many steps this mode typically requires?

Student 4
Student 4

I think it requires seven steps.

Teacher
Teacher

Exactly! So, to remember, think: 'Seven Steps for Indirect: I7!' Let's summarize what we've learned today.

Comparing Addressing Modes

Unlock Audio Lesson

0:00
Teacher
Teacher

Let's recap what we've discussed regarding the different addressing modes. Immediate addressing is the simplest, followed by direct and then indirect. Who can tell me the order from least to most complex?

Student 1
Student 1

Immediate, Direct, and then Indirect.

Teacher
Teacher

Great! And the number of steps required are 4, 6, and 7 respectively. Any questions about how these modes work together?

Student 2
Student 2

So, why are more steps needed for indirect addressing?

Teacher
Teacher

Good question! It’s due to the need for extra memory accesses, which reflect the complexity in finding the operand's address.

Introduction & Overview

Read a summary of the section's main ideas. Choose from Basic, Medium, or Detailed.

Quick Overview

This section explains various addressing modes in computer architecture, including immediate, direct, and indirect modes, detailing the steps involved in instruction execution.

Standard

The section elaborates on different addressing modes, notably immediate, direct, and indirect. It describes how each mode affects the sequence of control instructions required for instruction execution in a computer’s architecture, highlighting the variations in steps taken for each mode.

Detailed

Detailed Summary

In the context of computer organization and architecture, understanding different addressing modes is vital for grasping how instructions are executed. This section provides a comprehensive exploration of several addressing modes, including immediate, direct, and indirect addressing.

Key Addressing Modes

  1. Immediate Mode: In immediate addressing mode, the operand is part of the instruction itself. This means that a single word instruction could look like LOAD R1, 32, where 32 is directly utilized in the operation. The steps of execution consist of fetching the instruction and transferring the immediate value to the specified register, which is straightforward with fewer steps — typically 4 micro instructions.
  2. Direct Mode: In direct addressing, the operand's memory address is specified directly in the instruction. For instance, the instruction might read LOAD R1, M, where M indicates the specific memory address. This mode involves more steps (6 micro instructions), as the program counter must load the address into the memory address register, read the operand from the memory data register, and then ultimately load it into the register specified.
  3. Indirect Mode: Indirect addressing means that the operand's address is indirectly specified via a pointer included in the instruction. This involves two memory accesses: first to retrieve the address pointing to the actual operand and secondly to load the operand itself. This mode usually requires the most steps (7 micro instructions), reflecting its complexity.

Significance

Understanding these addressing modes is crucial for comprehending how control signals are generated and utilized within computer architecture. Each mode influences the sequence and number of micro instructions needed for executing an instruction, thus playing a foundational role in processor design and performance.

Youtube Videos

One Shot of Computer Organisation and Architecture for Semester exam
One Shot of Computer Organisation and Architecture for Semester exam

Audio Book

Dive deep into the subject with an immersive audiobook experience.

Understanding Instruction Fetch Steps

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

As we have already discussed in the last unit that basically the first 3 steps that is step 1, step 2 and step 3, basically consist of instruction fetch. So, what happens in step 1? The program counter value is loaded into the bus. That bus basically or the program counter is read into memory address register. Memory is given in read mode and then actually in these 3 steps, ALU actually adds program counter value which is now in the bus with a constant value, which is the next memory location and then it is again waited to be loaded into the program counter in the next iteration.

Detailed Explanation

In the first three steps of instruction execution, we focus on fetching the instruction. Step 1 involves loading the value of the program counter (PC) onto a bus which carries data. This value is then read into the memory address register (MAR), indicating which memory location is to be accessed. The memory is set to 'read' mode to allow fetching of instructions. During these steps, the Arithmetic Logic Unit (ALU) adds the PC value to a constant that indicates the next memory address to access. After the instruction is fetched, the PC is updated for the next instruction. Essentially, these steps ensure that the processor retrieves the correct instruction to execute next.

Examples & Analogies

Imagine you're cooking a recipe. First, you check your recipe book (the program counter) to see what dish you must prepare next. You open the book to the right page (loading into the memory address register), and then you look for the next ingredient you need (the instruction), ensuring everything is ready for your next step in cooking.

Direct Addressing Mode

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

For example, if the instruction is a direct instruction that is you have to read something from or write something from the memory location. Then in the fourth stage, what is going to happen basically, you are going to take from the instruction register the value of M which corresponds to the memory location for an instruction because it’s a direct instruction. So, the value of the operand will be present in memory location M which will be specified in the instruction itself.

Detailed Explanation

In direct addressing mode, the instruction specifies the exact memory location (M) where the relevant operand is stored. In the fourth step of instruction execution, the processor retrieves this memory location value from the instruction register (IR) and loads it into the memory address register (MAR). The next step is to set the memory to read mode, which allows for retrieval of the operand stored at this specified memory address. After the reading process is completed, the operand is transferred to the appropriate registers for execution.

Examples & Analogies

Consider having a written shopping list (the instruction) where it specifically states to get apples from aisle 5 in the supermarket (the memory location). You head directly to aisle 5 (the processor fetching the value from memory) to collect your apples (the operand) without having to search elsewhere.

Indirect Addressing Mode

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

But in case say for example, if it is an indirect instruction where the memory location M actually points to another memory location which has the operand. So, basically it’s an address to another location maybe say for example.

Detailed Explanation

In indirect addressing mode, the instruction does not directly specify the operand; instead, it provides a memory location (M) that contains the address of the actual operand. This means that the first operation involves reading the address from M into the MAR, and then retrieving the operand stored at that secondary address. This process adds an extra step compared to direct addressing, where the operand is immediately accessible at the address specified in the instruction.

Examples & Analogies

Think of it like getting directions to a friend's house (the memory location) via your navigation app. The directions may lead you to a meeting point (the first address) that gives you additional directions to your friend's actual house (the operand) - therefore, you need to take an extra step to reach your destination.

Immediate Addressing Mode

Unlock Audio Book

Signup and Enroll to the course for listening the Audio Book

So, first instruction mode the simplest one is the immediate mode. So, we are just saying LOAD R, 32; that means, the value of 32 constant will be loaded to R.

Detailed Explanation

In immediate addressing mode, the operand is directly specified in the instruction itself, making it the simplest addressing mode. For example, an instruction like 'LOAD R, 32' indicates that the constant value of 32 should be loaded into register R directly. There are fewer steps involved as there is no need to access memory to get the operand, just a straightforward transfer from the instruction register to the targeted register.

Examples & Analogies

Imagine you are buying a ready-made meal (the instruction) that is specified on the packaging to heat for a few minutes (the operand itself). There’s no need to measure or cook anything; you simply place it in the microwave as stated – just like directly loading the value into the register.

Definitions & Key Concepts

Learn essential terms and foundational ideas that form the basis of the topic.

Key Concepts

  • Immediate Addressing: Operand is directly within the instruction.

  • Direct Addressing: Operand’s address appears directly in the instruction.

  • Indirect Addressing: Operand’s address is specified indirectly via another memory location.

  • Control Signals: Directives in a CPU that dictate instruction execution.

  • Micro Instructions: Fundamental actions constituting the complete instruction.

Examples & Real-Life Applications

See how the concepts apply in real-world scenarios to understand their practical implications.

Examples

  • Immediate Addressing Example: LOAD R1, 32 loads the immediate value 32 into register R1 with 4 micro instructions.

  • Direct Addressing Example: LOAD R1, M retrieves the operand from memory location M, requiring 6 micro instructions.

  • Indirect Addressing Example: LOAD R1, (M) first accesses M to find the actual operand's address, needing 7 micro instructions.

Memory Aids

Use mnemonics, acronyms, or visual cues to help remember key information more easily.

🎵 Rhymes Time

  • Immediate is neat, with values that meet, Put them in the instruction seat.

📖 Fascinating Stories

  • Imagine a librarian where you go directly to the books (direct addressing) or you ask a friend to fetch a book (indirect addressing), finding knowledge through the shortest path possible (immediate).

🧠 Other Memory Gems

  • Remember: 'I - 4 for Immediate, D - 6 for Direct, I - 7 for Indirect'.

🎯 Super Acronyms

D7I

  • Direct takes six
  • Indirect takes seven
  • Immediate takes four.

Flash Cards

Review key concepts with flashcards.

Glossary of Terms

Review the Definitions for terms.

  • Term: Immediate Addressing

    Definition:

    A mode in which the operand is part of the instruction itself.

  • Term: Direct Addressing

    Definition:

    A mode where the operand’s address is specified directly in the instruction.

  • Term: Indirect Addressing

    Definition:

    A mode where the address of the operand is held in a memory location specified by the instruction.

  • Term: Control Signals

    Definition:

    Signals used in a computer system to control the sequences of actions.

  • Term: Micro Instructions

    Definition:

    The low-level operations that define the steps to execute an instruction.