0
650views
What is an instruction queue? Explain?
1 Answer
0
3views

The Instruction Queue:

  1. The execution unit (EU) is supposed to decode or execute an instruction.
  2. Decoding does not require the use of buses.
  3. When EU is busy decoding and executing an instruction, the BIU fetches up to six instruction bytes for the next instructions.
  4. These bytes are called the pre-fetched bytes and they are stored in a first in first out (FIFO) register set, which is called a queue.

Significance of Queue:

enter image description here

  1. As shown in the above figure, while the EU is busy decoding the instruction corresponding to memory location 100F0, the BIU fetches the next six instruction bytes from locations 100F1 to 100F6 numbered as 1 to 6.
  2. These instruction bytes are stored in the 6-byte queue on the first in first out (FIFO) basis.
  3. When EU completes the execution of the existing instruction and becomes ready for the next instruction, it simply reads the instruction bytes in the sequence 1, 2…. from the Queue.
  4. Thus the Queue will always hold the instruction bytes of the next instructions to be executed by the EU.

Pipelining:

  1. The process of fetching the next instruction when the present instruction is being executed is called pipelining.
  2. Pipelining has become possible due to the use of queues.
  3. BIU (Bus Interfacing Unit) fills in the queue until the entire queue is full.
  4. BIU restarts filling in the queue when at least two locations of the queue are vacant.

Advantages of pipelining:

  1. The execution unit always reads the next instruction byte from the queue in BIU. This is faster than sending out an address to the memory and waiting for the next instruction byte to come.
  2. In short pipelining eliminates the waiting time of EU and speeds up the processing.
  3. The 8086 BIU will not initiate a fetch unless and until there are two empty bytes in its queue. 8086 BIU normally obtains two instruction bytes per fetch.

8086 Queue is only Six Byte long:

  1. This is because the longest instruction in the instruction set of 8086 is six bytes long.
  2. Hence with a six-byte long queue it is possible to pre-fetch even the longest instruction in the main program.
Please log in to add an answer.