A computer uses a memory unit of 512𝐾 words of 32 bits each. A binary…

2019

A computer uses a memory unit of 512𝐾 words of 32 bits each. A binary instruction code is stored in one word of the memory. The instruction has four parts: an addressing mode field to specify one of the two-addressing mode (direct and indirect), an operation code, a register code part to specify one of the 256 registers and an address part. How many bits are there in addressing mode part, opcode part, register code part and the address part?

  1. A.

    1,3,9,19

  2. B.

    1,4,9,18

  3. C.

    1,4,8,19

  4. D.

    1,3,8,20

Attempted by 222 students.

Show answer & explanation

Correct answer: C

Key facts: memory = 512K words, word size = 32 bits, instruction stored in one word, addressing modes = 2, registers = 256.

  • Address part: number of words = 512K = 512 × 1024 = 2^9 × 2^10 = 2^19, so address needs 19 bits.

  • Register code part: to specify 256 registers requires log2(256) = 8 bits.

  • Addressing mode part: two addressing modes (direct and indirect) require log2(2) = 1 bit.

  • Opcode part: remaining bits = 32 − (addressing mode + register code + address) = 32 − (1 + 8 + 19) = 4 bits.

Final bit allocation: addressing mode = 1 bit, opcode = 4 bits, register code = 8 bits, address = 19 bits.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor