GATE Computer ScienceModerateGATE CS (PYQ pattern)

A processor encodes branch targets as a 16-bit signed offset relative to the incremented PC in 2-byte instruction units (target = PC + 2 × offset, PC already points to the next instruction). A branch at address 0x4000 has offset field 0xFFF0 (two's complement). What is the target address?

  1. A. 0x4022
  2. B. 0x3FF2
  3. C. 0x3FE2
  4. D. 0x3FE0

Correct answer: C. 0x3FE2

0xFFF0 is −16. PC after fetching a 2-byte branch = 0x4002, so target = 0x4002 − 32 = 0x3FE2. Forgetting the PC increment gives 0x3FE0; forgetting the unit scaling gives 0x3FF2.

More Computer Organization and Architecture questions

Exams that ask this topic