0
votes

PC memory module contains 512k words. Word has 64 bits. Binary instruction has four segments: indirect bit, operation code, register code part to determine one of the 32 registers and address part. Instruction binary code is stored in word memory.

  1. How many bits are needed for the opcode, register code and the address segment?

Indirect: 1 bit

Reg: 5 (2^5 = 32)

Address: 19 (2^19 = 512k)

Op-code = 64 - 5 – 19 = 40 bits

I think my answer is correct, but practically an opcode cannot have 40 bits. (That's trillion of instructions). Is 40 correct?

1

1 Answers

0
votes

Your answer is correct, except that you forgot to subtract the indirect bit for a total of 64 - 5 - 19 - 1 = 39.

Not all the 39 bits need to be part of the opcode.
In general the bits of the opcode fields are calculated from the number of opcodes, which has not been given.

Those 39 bits can be used or reserved for future use.
For example, 3 bits could be used to specify a byte in each word (thereby extending the address bits).
Another 19 bits could be used to specify a second address or so on.