in CO and Architecture retagged by
5,088 views
7 votes
7 votes

What is the intial pc value meaning 

530=Pc + value 

what should be the pc value 

631 or 632 or 633 basically 

the instruction length is not give so how can i determine the addr loaded in pc hen instructtion at 630 is executing because if instruction length is 4 bytes it should be 634 

thanks in advance

in CO and Architecture retagged by
5.1k views

3 Comments

"the instruction length is not given"

So, you should ask this to the guy who made the question :)
For solving assume the instruction size is 2 bytes. 

1
1
well it is given in stallings and the solution is given to be

assuming relative value=530-631

i am confused how did he make this assumtion

2 bytes wont be sufficent as 10 bit address field is in the instruction atleast we need 3 bytes

could you look at this question also are ask someone else its giving me sleepless nights

https://gateoverflow.in/986/gate2009_45
0
0
when the branch instr is executing,what is exactly the content of the PC?

630 or 620
0
0

1 Answer

7 votes
7 votes
Best answer
Since the address part of the instruction is 10 bits, I assume instruction length is 16 bits = 2 bytes.

So, PC value during execution of branch instruction = 620 + 2 = 622 (PC always contains the next instruction address)

Now, branch is PC relative and the address to jump is 530, the operand will be 530 - 622 = -92 =  (10100100)2 (2's complement representation. )
edited by
by

4 Comments

the representation should be (1110100100) base2
right?
0
0
Why did you use $10$ bits?
0
0
Because in the question the address field is given 10 bits long.
0
0

Related questions

3 votes
3 votes
3 answers
3