Instruction start address => 5004
Instruction size => 4B
PC storing the next instruction address as => 5008.
Max. unsigned number possible with 14 bits (unsigned offset) = 2^14 -1 => 16383
Target address = PC + offset = 5008 + 16383 => 21391
In the question, it is asked to find the number of instructions from the
BEQ instruction (i.e. Number of instructions possible from instruction 5004)
(21391 – 5008 + 1) / 4B => 4096.
Here, (21391-5008+1) is used to calculate the number of addresses present starting from 5008 to 21391.
Therefore, the answer will be 4096.