A computer uses a memory unit with 256 K words of 32 bits each. A binary…
2018
A computer uses a memory unit with 256 K words of 32 bits each. A binary instruction code is stored in one word of memory. The instruction has four parts: an indirect bit, an operation code and a register code part to specify one of 64 registers and an address part. How many bits are there in the operation code, the register code part and the address part?
- A.
7,6,18
- B.
6,7,18
- C.
7,7,18
- D.
18,7,7
Attempted by 243 students.
Show answer & explanation
Correct answer: A
Solution:
Determine the number of address bits: 256 K words = 256 × 1024 = 262,144 words. Number of address bits = log2(262,144) = 18.
Determine the register field size: to specify one of 64 registers requires log2(64) = 6 bits.
Account for the indirect bit: this uses 1 bit.
Compute the operation code bits: total instruction length is 32 bits, so operation bits = 32 − (indirect bit + register bits + address bits) = 32 − (1 + 6 + 18) = 7.
Answer: operation code = 7 bits, register code = 6 bits, address part = 18 bits.
A video solution is available for this question — log in and enroll to watch it.