GATE Computer ScienceHardGATE CS (PYQ pattern)
A RISC machine has 32-bit (4-byte) instructions at word-aligned addresses and a PC-relative branch with a 12-bit signed offset field counted in words. The target is computed as (address of branch + 4) + 4 × offset. What are the largest forward and backward distances of a target from the branch instruction's own address?
- A. +8196 bytes forward, −8192 bytes backward
- B. +2048 bytes forward, −2048 bytes backward
- C. +8188 bytes forward, −8192 bytes backward
- D. +8192 bytes forward, −8188 bytes backward
Correct answer: D. +8192 bytes forward, −8188 bytes backward
Offset ranges −2048..+2047 words. Forward: 4 + 4·2047 = 8192 bytes. Backward: 4 − 4·2048 = −8188 bytes. The extra +4 is because PC has already advanced.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A direct-mapped cache has 8 lines (block = 1 word). A program issues block references [0, 8, 0, 8, 1, 9, 1, 9, 2, 10, 2, 10, 0, 8, 1, 9]…
- An 8-bit CPU adds the 16-bit two's-complement numbers 0x7F9C and 0x00A7 with ADD on the low bytes followed by ADC (add with carry) on the…
- A disk spins at 7200 rpm with 400 sectors of 512 B per track, an average seek of 9 ms and a 0.2 ms controller overhead. A 64 KB block (1…
- A DMA controller uses cycle stealing and may take at most 20% of the bus cycles. Bus 1 is 32 bits wide with a 50 ns cycle; bus 2 is 64…
- Ideal CPI is 1. Every instruction fetch misses the L1 I-cache 2% of the time; 30% of instructions are loads/stores and miss the L1 D-cache…
- Three enhancements with speed-ups 30, 20 and 15 apply to disjoint parts of a program's original run time. The first two each apply to 25%…