1. Arithmetic Pipeline:
The arithmetic pipeline divides the arithmetic problem into various sub-problems for execution in various pipeline segments. It is used for floating-point arithmetic, multiplication, and various other calculations. The diagram shows a process or flowchart arithmetic pipeline for floating-point addition.
Use the arithmetic pipeline for floating-point addition:
In this case, the following sub-operations are performed:
- Compare indices.
- Align mantissas.
- Add or subtract the mantissa number.
- Normalized results
Start by comparing the two indices, and then choose the larger of the two indices as the resulting index. Then, the difference in the exponents determines how many times we have to move the smaller exponents to the right. Then, after moving the exponent, both mantissa are aligned. Finally, the two numbers are added together and the results are normalized in the last fragment.
Example:
Let’s consider two numbers,
X=0.3214*10^3 and Y=0.4500*10^2
Illustrate:
First, subtract the two exponents to get 3-2 = 1. Thus 3 becomes the exponent of the result, and the smaller exponent is shifted to the right 1 time, which is obtained
Y=0.0450*10^3
Finally, the two numbers are added together
Z=0.3664*10^3
Since the results have been standardized, the results remain the same.
2. Instruction pipeline:
In this way, the instruction flow can be executed by overlapping the acquisition, decoding, and execution phases of the instruction cycle. Such techniques are used to increase the throughput of computer systems. The instruction pipeline reads instructions from memory, while other instructions are being executed in other segments of the pipeline. As a result, we can execute multiple instructions at the same time. If the instruction cycle is divided into segments of equal length, the pipeline is more efficient.
In the most general case, the computer needs to process each instruction sequentially following these steps:
- Extract instructions from memory (FI).
- Decode Instruction (DA)
- Calculate valid addresses
- Extract operands from memory (FO).
- Execution Instruction (EX)
- Store the results in the right place
The flow diagram of the instruction pipeline is shown below.
Let’s look at an example of an instruction pipeline.
Example:
Here, the instruction is taken at the first clock cycle of segment 1.
Now decode it in the next clock cycle, then get the operand, and finally execute the instruction. We can see that here the fetch and decode phases overlap due to the pipeline. When the first instruction is decoded, the pipeline will extract the next instruction.
In the case of the third directive, we see that this is a branch directive. Here, when it is decoded, the 4th instruction is extracted at the same time. But since it’s a branching instruction, it may point to other instructions when decoded. Therefore, the fourth instruction will remain in place until the branch instruction is executed. When it is executed, the fourth instruction is copied back, and the rest of the phases continue as usual.