GATE Computer ScienceModerateGATE CS (PYQ pattern)
An x86-like addressing mode computes EA = base + index × scale + displacement, where the displacement is an 8-bit field that is sign-extended to 32 bits. With base = 0x1000, index = 0x20, scale = 4 and displacement field 0xFC, what is the effective address?
- A. 0x107C
- B. 0x117C
- C. 0x101C
- D. 0x111C
Correct answer: A. 0x107C
0xFC as a signed byte is −4. EA = 0x1000 + 0x20 × 4 − 4 = 0x1000 + 0x80 − 4 = 0x107C. Zero-extending the displacement gives 0x117C; forgetting the scale gives 0x101C; both slips together give 0x111C.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A 32-bit carry-select adder is built from blocks. A block of n bits contains two ripple adders (carry-in 0 and 1) that have their…
- A device produces a 40,000 bytes/s stream into a 16-byte buffer, and the CPU (500 MHz) polls it periodically, never letting the buffer…
- Three caches with 4 one-word lines each see the block trace [0, 1, 2, 3, 0, 4, 1, 5, 2, 6, 3, 7, 0, 4]: (i) direct-mapped, (ii) 2-way…
- A 64-byte, 2-way set-associative cache with 16-byte blocks and LRU replacement is empty. The processor reads these byte addresses in…
- A 16-bit instruction set has 4-bit address fields and expanding opcodes: three-address instructions use a 4-bit opcode, two-address…
- 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…