principles of linear pipelining. example : floating point adder unit

46
Principles of Linear Pipelining

Upload: laurence-cox

Post on 14-Dec-2015

288 views

Category:

Documents


21 download

TRANSCRIPT

Page 1: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Principles of Linear Pipelining

Page 2: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Example : Floating Point Adder Unit

Page 3: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Floating Point Adder Unit• This pipeline is linearly constructed with 4

functional stages.• The inputs to this pipeline are two normalized

floating point numbers of the formA = a x 2p

B = b x 2q

where a and b are two fractions and p and q are their exponents.

• For simplicity, base 2 is assumed

Page 4: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Floating Point Adder Unit

• Our purpose is to compute the sum C = A + B = c x 2r = d x 2s

where r = max(p,q) and 0.5 ≤ d < 1• For example:

A=0.9504 x 103

B=0.8200 x 102

a = 0.9504 b= 0.8200p=3 & q =2

Page 5: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Floating Point Adder Unit

• Operations performed in the four pipeline stages are :

1. Compare p and q and choose the largest exponent, r = max(p,q)and compute t = |p – q|Example: r = max(p , q) = 3t = |p-q| = |3-2|= 1

Page 6: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Floating Point Adder Unit

2. Shift right the fraction associated with the smaller exponent by t units to equalize the two exponents before fraction addition.

• Example: Smaller exponent, b= 0.8200 Shift right b by 1 unit is 0.082

Page 7: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Floating Point Adder Unit

3. Perform fixed-point addition of two fractions to produce the intermediate sum fraction c, where 0 ≤ c < 1

• Example : a = 0.9504 b= 0.082c = a + b = 0.9504 + 0.082 = 1.0324

Page 8: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Floating Point Adder Unit4. Count the number of leading zeros (u) in

fraction c and shift left c by u units to produce the normalized fraction sum d = c x 2u, with a leading bit 1. Update the large exponent s by subtracting s = r – u to produce the output exponent.

• Example:c = 1.0324 , u = -1 right shift d = 0.10324 , s= r – u = 3-(-1) = 4C = 0.10324 x 104

Page 9: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Floating Point Adder Unit

• The above 4 steps can all be implemented with combinational logic circuits and the 4 stages are:

1. Comparator / Subtractor2. Shifter3. Fixed Point Adder4. Normalizer (leading zero counter and shifter)

Page 10: Principles of Linear Pipelining. Example : Floating Point Adder Unit

4-STAGE FLOATING POINT ADDERA = a x 2p B = b x 2q

a b AB

Exponentsubtractor

Fractionselector

Fraction with min(p,q)

Right shifter

Otherfraction

t = |p - q|r = max(p,q)

Fractionadder

Leading zerocounter

r c

Left shifterc

Exponentadder

r

s d

d

Stages:

S1

S2

S3

S4

C= X + Y = d x 2s

Page 11: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Example for floating-point adder Exponents

Segment 1:

Segment 2:

Segment 3:

Segment 4:

R R

R

R

R

R

R

R

Adjustexponent

Normalizeresult

Addmantissas

Align mantissas

Choose exponent

Compareexponents

by subtraction

Difference=3-2=1

Mantissasba A B

For example:X=0.9504*103

Y=0.8200*102

0.082

3

S=0.9504+0.082=1.0324

0.103244

Page 12: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Classification of Pipeline Processors

• There are various classification schemes for classifying pipeline processors.

• Two important schemes are1.Handler’s Classification2.Li and Ramamurthy's Classification

Page 13: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Handler’s Classification

• Based on the level of processing, the pipelined processors can be classified as:

1.Arithmetic Pipelining2.Instruction Pipelining3.Processor Pipelining

Page 14: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Arithmetic Pipelining

• The arithmetic logic units of a computer can be segmented for pipelined operations in various data formats.

• Example : Star 100

Page 15: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Arithmetic Pipelining

Page 16: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Arithmetic Pipelining

• Example : Star 100– It has two pipelines where arithmetic operations

are performed– First: Floating Point Adder and Multiplier– Second : Multifunctional • All scalar instructions • Floating point adder, multiplier and divider.

– Both pipelines are 64-bit and can be split into four 32-bit at the cost of precision

Page 17: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Star 100 Architecture

Page 18: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Instruction Pipelining• The execution of a stream of instructions can

be pipelined by overlapping the execution of current instruction with the fetch, decode and operand fetch of the subsequent instructions

• It is also called instruction look-ahead

Page 19: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Instruction Pipelining

Page 20: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Example : 8086

• The organization of 8086 into a separate BIU and EU allows the fetch and execute cycle to overlap. This is called pipelining.

Page 21: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Processor Pipelining

• This refers to the processing of same data stream by a cascade of processors each of which processes a specific task

• The data stream passes the first processor with results stored in a memory block which is also accessible by the second processor

• The second processor then passes the refined results to the third and so on.

Page 22: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Processor Pipelining

Page 23: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Li and Ramamurthy's Classification

• According to pipeline configurations and control strategies, Li and Ramamurthy classify pipelines under three schemes– Unifunction v/s Multi-function Pipelines– Static v/s Dynamic Pipelines– Scalar v/s Vector Pipelines

Page 24: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Uni-function v/s Multi-function Pipelines

Page 25: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Unifunctional Pipelines

• A pipeline unit with fixed and dedicated function is called unifunctional.

• Example: CRAY1 (Supercomputer - 1976)• It has 12 unifunctional pipelines described in

four groups:– Address Functional Units:• Address Add Unit• Address Multiply Unit

Page 26: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Unifunctional Pipelines

– Scalar Functional Units• Scalar Add Unit• Scalar Shift Unit• Scalar Logical Unit• Population/Leading Zero Count Unit

– Vector Functional Units• Vector Add Unit• Vector Shift Unit• Vector Logical Unit

Page 27: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Unifunctional Pipelines

– Floating Point Functional Units• Floating Point Add Unit • Floating Point Multiply Unit• Reciprocal Approximation Unit

Page 28: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Cray 1 : Architecture

Page 29: Principles of Linear Pipelining. Example : Floating Point Adder Unit
Page 30: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Cray -1

Page 31: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Multifunctional

• A multifunction pipe may perform different functions either at different times or same time, by interconnecting different subset of stages in pipeline.

• Example 4X-TI-ASC (Supercomputer - 1973)

Page 32: Principles of Linear Pipelining. Example : Floating Point Adder Unit

4X-TI ASC

• It has four multifunction pipeline processors, each of which is reconfigurable for a variety of arithmetic or logic operations at different times.

• It is a four central processor comprised of nine units.

Page 33: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Multifunctional• It has – one instruction processing unit– four memory buffer units and– four arithmetic units.

• Thus it provides four parallel execution pipelines below the IPU.

• Any mixture of scalar and vector instructions can be executed simultaneously in four pipes.

Page 34: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Architecture Overview of 4X-TI ASC

Page 35: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Static Vs Dynamic Pipeline

Page 36: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Static Pipeline• It may assume only one functional

configuration at a time• It can be either unifunctional or

multifunctional• Static pipelines are preferred when

instructions of same type are to be executed continuously

• A unifunction pipe must be static.

Page 37: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Dynamic pipeline

• It permits several functional configurations to exist simultaneously

• A dynamic pipeline must be multi-functional• The dynamic configuration requires more

elaborate control and sequencing mechanisms than static pipelining

Page 38: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Scalar Vs Vector Pipeline

Page 39: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Scalar Pipeline

• It processes a sequence of scalar operands under the control of a DO loop

• Instructions in a small DO loop are often prefetched into the instruction buffer.

• The required scalar operands are moved into a data cache to continuously supply the pipeline with operands

• Example: IBM System/360 Model 91

Page 40: Principles of Linear Pipelining. Example : Floating Point Adder Unit

IBM System/360 Model 91• In this computer, buffering plays a major role. • Instruction fetch buffering:– provide the capacity to hold program loops of

meaningful size.– Upon encountering a loop which fits, the buffer locks

onto the loop and subsequent branching requires less time.

• Operand fetch buffering:– provide a queue into which storage can dump

operands and execution units can fetch operands.– This improves operand fetching for storage-to-

register and storage-to-storage instruction types.

Page 41: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Architecture overview of IBM 360/Model 91

Page 42: Principles of Linear Pipelining. Example : Floating Point Adder Unit
Page 43: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Vector Pipelines

• They are specially designed to handle vector instructions over vector operands.

• Computers having vector instructions are called vector processors.

• The design of a vector pipeline is expanded from that of a scalar pipeline.

• The handling of vector operands in vector pipelines is under firmware and hardware control.

• Example : Cray 1

Page 44: Principles of Linear Pipelining. Example : Floating Point Adder Unit
Page 45: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Linear pipeline (Static & Unifunctional)

• In a linear pipeline data flows from one stage to another and all stages are used once in a computation and it is for one functional evaluation.

Page 46: Principles of Linear Pipelining. Example : Floating Point Adder Unit

Non-linear pipeline• In floating point adder, stage (2) and (4)

needs a shift register. • We can use the same shift register and then

there will be only 3 stages.• Then we should have a feedback from third

stage to second stage. • Further the same pipeline can be used to

perform fixed point addition.• A pipeline with feed-forward and/or

feedback connections is called non-linear