edited by
6,998 views
31 votes
31 votes

The instruction format of a CPU is:

$\text{Mode}$ and $\text{RegR}$ together specify the operand. $\text{RegR}$ specifies a CPU register and $\text{Mode}$ specifies an addressing mode. In particular, $\text{Mode}=2$ specifies that ‘the register $\text{RegR}$ contains the address of the operand, after fetching the operand, the contents of $\text{RegR}$ are incremented by $1$'.

An instruction at memory location $2000$ specifies $\text{Mode}= 2$ and the $\text{RegR}$ refers to program counter (PC).

  1. What is the address of the operand?

  2. Assuming that is a non-jump instruction, what are the contents of PC after the execution of this instruction?

edited by

3 Answers

Best answer
40 votes
40 votes
  1. Address of the operand $=$ content of PC $= 2001$ as PC holds the address of the next instruction to be executed and instruction size is $1-word$ as given in the diagram.
  2. After execution of the current instruction PC will be automatically incremented by $1$ when the next instruction is fetched. Also one extra increment will be done by operand fetch. So, PC $= 2003$ supposing next instruction is fetched. If we assume next instruction fetch is not done (this should be the default here), it should be $2002$.
edited by
11 votes
11 votes
We will

      1) Fetch the instruction at 2000 and increment PC to point to next instruction which will be at 2001 .. So 2001 ... Here RegR will be having 2001 and after operand fetching we will make RegR as 2002
7 votes
7 votes
A.During the instruction fetch the content of the PC can be incremented if we have separate hardware for it.Else it will happen just after IF phase of instruction cycle.When the instruction at 2000 is fetched its PC will point point to 2001 which is the address of the operand.

B.If the current instruction is not a jump instruction PC will point to the next word of memory,which is 2001.During the execution of the current program the Pc value will become 2002 as there is an extra increment.Now if we have the next instruction fetch then PC will again get incremented to 2003.

Related questions

49 votes
49 votes
6 answers
1
30 votes
30 votes
4 answers
3
Kathleen asked Sep 29, 2014
4,524 views
Let $\left(\{ p,q \},*\right)$ be a semigroup where $p*p=q$. Show that:$p*q=q*p$ and$q*q=q$