A 16-bit CPU is trying to access a double word starting at an odd address. How…

2014

A 16-bit CPU is trying to access a double word starting at an odd address. How many memory operations are required to access the data?

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. D.

    4

Attempted by 469 students.

Show answer & explanation

Correct answer: C

Concept: A CPU with an N-byte memory bus can complete one memory operation only against an aligned N-byte block — an address that is a multiple of N. A multi-byte item is fetched in a single operation only when it lies entirely inside one such aligned block; if it starts at a misaligned address, it spans extra aligned blocks, and one memory operation is needed for every aligned block the item touches.

Application: For this 16-bit CPU (2-byte bus) reading a 4-byte double word from an odd starting address:

  1. The bus width is 2 bytes, so the aligned addresses are the even ones: 0, 2, 4, 6, and so on.

  2. Take a representative odd start, address 1 (any odd address behaves the same way modulo 2); the double word then occupies bytes 1, 2, 3, and 4.

  3. Group those bytes into the aligned 2-byte blocks the CPU can actually fetch: block 0-1 holds byte 1, block 2-3 holds bytes 2 and 3, and block 4-5 holds byte 4.

  4. Three distinct aligned blocks are touched — block 0-1, block 2-3, and block 4-5 — so three memory operations are needed, even though part of the first and third fetches is discarded.

Cross-check: A general formula gives the same count: number of operations = floor((offset + size − 1) / bus width) + 1, where offset is the start address's remainder when divided by the bus width. Here offset = 1, size = 4 bytes, bus width = 2 bytes, giving floor(4/2) + 1 = 2 + 1 = 3, matching the block count above. Equivalently, an aligned 4-byte access would need only 4 / 2 = 2 operations, and a misalignment inside a block always forces exactly one additional operation.

Result: 3 memory operations are required.

Explore the full course: Isro