GATE Computer ScienceHardGATE CS (PYQ pattern)

A MIPS-like J instruction has a 26-bit field holding a word address; the target is formed from the top 4 bits of PC + 4, followed by the 26-bit field, followed by 00. A J at address 0x0FFFFFFC has field value 0x0000100. What is the jump target?

  1. A. 0x00000400
  2. B. 0x10000400
  3. C. 0x10000100
  4. D. 0x00000100

Correct answer: B. 0x10000400

PC + 4 = 0x10000000, so the top 4 bits are 0001, not the 0000 of the J's own address. Field << 2 = 0x400. Target = 0x10000000 | 0x400 = 0x10000400. Using the J's own address bits gives 0x00000400; forgetting the shift gives 0x10000100. A J in the last word of a 256 MB region can only reach the next region.

More Computer Organization and Architecture questions

Exams that ask this topic