In: Computer Science
The machine language form of a jump instruction (j) is 00001001001100101000110001010110. The address of the jump instruction (PC) is 0x20201018. What address this the program will jump to?
The answer for the above mentioned question is explained below ::
The program will jump to the following address :
00100100110010100011000101011000
Explanation is as follows ::
Given that , the machine language form for jump instruction is
000010 01001100101000110001010110
where , first six bits represent opcode i.e., here 000010 represents the opcode j .
The remaining 26 bits represents the address , to get the final address to which the given instruction jumps , we have to multiply the 26 bit address field by 4 , so after multiplication of 26 bits by 4 we get 28 bits and we append most significant 4 bits from the PC , i.e., here PC is 0x20201018 here most significant 4 bits is 0010 . Therefore the above program will jump to the address 00100100110010100011000101011000 .
Explanation in terms of Addresses ::
Machine language form for jump instruction is ::
00001001001100101000110001010110
Here first 6 bits represents opcode j i.e., 000010 represents j and remaining 26 bits represents the target address i.e., 01001100101000110001010110
To get the resultant address to which the given program jump is first 4 bits are taken from the most significant 4 bits of PC and next 28 bits are taken from the (26 bit *4) .
i.e., Here most significant 4 bits of PC is 0010 .
and 26 bits *4 is 0100110010100011000101011000
Therefore the given program jump to the address
00100100110010100011000101011000