Electronic – Instruction Register Size in Processors

cacheembeddedmicroprocessor

I am learning processor basics. I have this doubt.

If I have a processor with 9 one-byte instructions and one 2-bytes instruction in its instruction set architecture, should n't the instruction register of the processor be 16 bits instead of 8-bits ? Say for example:

2000  MOV A,B
2001  MVI C, 20h  --- 2 byte instruction

In my book it says PC points to address 2003 after 2001. So it means, when PC was pointing to 2001, both the 8-bit immediate data and the 8-bit opcode were fetched into the instruction register in one go right ? Or is it fetched in two cycles ? Also I would like to know what is the significance of data and instruction caches in a processor. Is it neccesary in a processor ?

Best Answer

The instruction register generally holds only the bits that constitute the "opcode" part of an instruction (including any bits that affect addressing modes) for the duration of the execution of the instruction, so that the instruction decoding logic has access to it.

Any bytes in the instruction that are only operands are not generally held in the instruction register.

If the bus width of the processor is only 8 bits, then the two bytes of the instruction are fetched in separate cycles. The second cycle is executed after the instruction decode logic has decided that there is a second byte as a result of examining the opcode in the first byte.

And no, caches are not necessary to the operation of a processor, but they help eliminate bottlenecks when the processor is faster than the main memory.

Related Topic