Prefetch Input Queue - Instruction Queue

Instruction Queue

The processor executes a program by fetching the instructions from memory and executing them. Usually the processor execution speed is much faster than the memory access speed. Instruction queue is used to prefetch the next instructions in a separate buffer while the processor is executing the current instruction.

With a four stage pipeline, the rate at which instructions are executed is four times that of sequential execution.

The processor usually has two separate units for fetching the instructions and for executing the instructions.

The implementation of a pipeline architecture is possible only if the bus interface unit and the execution unit are independent. While the execution unit is decoding or executing an instruction which does not require the use of the data and address buses, the bus interface unit fetches instruction opcodes from the memory.

This process is much faster than sending out an address, reading the opcode and then decoding and executing it. Fetching the next instruction while the current instruction is being decoded or executed is called pipelining.

The 8086 architecture has a six-byte prefetch instruction pipeline. As the Execution Unit is executing the current instruction, the bus interface unit reads up to six bytes of opcodes in advance from the memory. The six byte long queue was chosen because the maximum number of bytes required for any instruction in 8086 is this long.

An exception is encountered when the execution unit encounters a branch instruction i.e. either a jump or a call instruction. In this case, the entire queue must be dumped and the contents pointed to by the instruction pointer must be fetched from memory.

Read more about this topic:  Prefetch Input Queue

Famous quotes containing the words instruction and/or queue:

    One year, I’d completely lost my bearings trying to follow potty training instruction from a psychiatric expert. I was stuck on step on, which stated without an atom of irony: “Before you begin, remove all stubbornness from the child.” . . . I knew it only could have been written by someone whose suit coat was still spotless at the end of the day, not someone who had any hands-on experience with an actual two-year-old.
    Mary Kay Blakely (20th century)

    English people apparently queue up as a sort of hobby. A family man might pass a mild autumn evening by taking the wife and kids to stand in the cinema queue for a while and then leading them over for a few minutes in the sweetshop queue and then, as a special treat for the kids, saying “Perhaps we’ve time to have a look at the Number Thirty-One bus queue before we turn in.”
    Calvin Trillin (b. 1940)