in CO and Architecture retagged by
18,277 views
58 votes
58 votes

Which of the following is/are true of the auto-increment addressing mode?

  1. It is useful in creating self-relocating code

  2. If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation

  3. The amount of increment depends on the size of the data item accessed

  1. I only
  2. II only
  3. III only
  4. II and III only
in CO and Architecture retagged by
18.3k views

4 Comments

size of the data item means char data takes 1B, integer takes 2B. so if stored data is in integer data type then auto-increment address will be 300 then 302 then 304...
if the base address is 300.
1
1
option C) is correct
0
0

Can anyone please clear my doubt. I came across the statement PC increases by step size which depends on the word length of the CPU ​​​​​​. So say I have a CPU whose word length is 4B and i want to access a integer array . So here will the increment be of 4B or 2B ? Assuming the memory is byte addressable

 

0
0
increment by 4B according to word adress bcoz pc contain only valid addresses.
0
0

4 Answers

101 votes
101 votes
Best answer

In auto increment addressing mode, the base address is incremented after operand fetch. This is useful in fetching elements from an array. But this has no effect in self-relocating code (where code can be loaded to any address) as this works on the basis of an initial base address. 

An additional ALU is desirable for better execution especially with pipelining, but never a necessity. 

Amount of increment depends on the size of the data item accessed as there is no need to fetch a part of a data. 

So, answer must be C only. 

edited by
by

4 Comments

For  increment we need a ALU but with the same ALU we can calculate the EA as well
0
0
using INC control if register is incremented then how it will know the stepsize ??
0
0
When an operand is accessed, the size of the operand is already known thus the value is incremented by the step size.
1
1
13 votes
13 votes

From Hamcher,

so answer is (C).

8 votes
8 votes
Correct answer (C)

Auto increment mode is used for incrementing and depends on size of data.
0 votes
0 votes
After determining the effective address, the value in the base register is incremented by the size of the data item that is to be accessed.
For example, (A7)+ would access the content of the address register A7, then increase the address pointer of A7 by 1 (usually 1 word). Within a loop, this addressing mode can be used to step through all the elements of an array or vector.

So, option (C) is right
Answer:

Related questions